Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Two-dimensional match/regex?

by osfameron (Hermit)
on May 22, 2002 at 10:44 UTC ( #168392=note: print w/replies, xml ) Need Help??


in reply to Re: Two-dimensional match/regex?
in thread Two-dimensional match/regex?

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...
(Apologies for dodgy regex, not tested and probably wrong).

thanks for the tip, I should have thought of that already!

Cheerio!
Osfameron
http://osfameron.perlmonk.org/chickenman/

Replies are listed 'Best First'.
Re: Re: Re: Two-dimensional match/regex?
by rsteinke (Scribe) on May 23, 2002 at 05:31 UTC
    You could always surround the terms which lie between the stuff you want to match with (), and check that $1, $2, etc. are the same length as the first, second, etc. line matched.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168392]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2021-09-19 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?