CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions: Multiple newlines problem with regexp: Edit Log

New User

Oct 24, 2013, 6:52 AM

Views: 20405
Multiple newlines problem with regexp


could anybody give me a hint regarding a problem I'm facing with a regexp? I am trying to search for the string: "Options None" that may be found within the following text, inside apache's httpd.conf:

<Directory />
... some text ...
Options None
... other text ...

I am using

$pattern =~ m/\n<Directory \/>.*Options None.*<\/Directory>\n/is

but the search is greedy and is not stopping at the first </Directory>, but rather at the last one in the file.

[^<]\/Directory> also did not do the trick. I think because it's stopping the search before it reaches my text sequence.


(This post was edited by sergiu1103 on Oct 24, 2013, 6:53 AM)

Edit Log:
Post edited by sergiu1103 (New User) on Oct 24, 2013, 6:53 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives