regex: working with parts of strings several times over..

2005-06-20 Thread Willy West
here is the original: willy needs to take a nap [EMAIL PROTECTED] here is the result that I want: willy needs to take a nap [EMAIL PROTECTED] if i have the whole thing in one variable $data, then $data =~ s/<(.+?)

Re: regex: working with parts of strings several times over..

2005-06-20 Thread Jeff 'japhy' Pinyan
On Jun 20, Willy West said: here is the original: willy needs to take a nap [EMAIL PROTECTED] here is the result that I want: willy needs to take a nap [EMAIL PROTECTED] if i have the whole thing in one variable $data, then $d

Re: regex: working with parts of strings several times over..

2005-06-20 Thread Willy West
> You want a look-ahead: > >$data =~ s{ > <(.+?)> # <, then one or more characters ($1), then > > (.*?)# zero or more characters ($2) > (?= <.+?> ) # look ahead for '<...>' (but don't actually match it) >}{<$1>$2}xg; aah... this is a very useful part of regula