in reply to Multiline Regex
I'm interested in knowing why you want this change.
By the way, it should speed things up to to eliminate impossible starting points.
if ( my ($line) = $str =~ /^(.*?$regex.*)/m ) { print "Matched Line $line\n" }
The .*? on the LHS makes it behave more naturally if you add subcaptures.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiline Regex
by Anonymous Monk on Oct 09, 2008 at 11:01 UTC | |
by ikegami (Patriarch) on Oct 09, 2008 at 11:02 UTC |