$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
In reply to Re: A regex that does this, but not that?
by BrowserUk
in thread A regex that does this, but not that?
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |