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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



sergiu1103
New User

Oct 24, 2013, 6:52 AM


Views: 19732
Multiple newlines problem with regexp

Hi,

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 ...
</Directory>

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.

Thanks

(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