Oct 24, 2013, 6:52 AM
Post #1 of 5
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:
... some text ...
... 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)