in reply to A regex that does this, but not that?
$var =~ s[\bt(?!est).*?t\b\s*][]g;
Update: sauoq's right. I omitted a \b.
perl> $var = "thought testament test tot 1 2 3 tesset"; perl> $var =~ s[\bt(?!est\b).*?t\b\s*][]g; print $var; test 1 2 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A regex that does this, but not that?
by sauoq (Abbot) on Nov 15, 2003 at 00:00 UTC | |
by BrowserUk (Patriarch) on Nov 15, 2003 at 01:11 UTC |