good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Re: Two-dimensional match/regex?by osfameron (Hermit) |
on May 22, 2002 at 10:44 UTC ( [id://168392]=note: print w/replies, xml ) | Need Help?? |
I think the above won't work as such, because it might
find false matches (e.g. where the second line isn't
aligned with the first.)
But, I could find the first line and then generate
a multi-line regex with the rest of the search string, using /m as you suggest: something like
/^.{$pos}$string1.*\n^.{$pos}$string2.*/m
to make it search only at the right position...
thanks for the tip, I should have thought of that already! Cheerio!
In Section
Seekers of Perl Wisdom
|
|