in reply to A regex that does this, but not that?

my $var = "thought test tot 1 2 3 tesset"; $var =~ s/(t.*?t)/($1 ne "test") ? "" : $1/ge; print $var;

Replies are listed 'Best First'.
Re: Re: A regex that does this, but not that?
by bradcathey (Prior) on Nov 15, 2003 at 00:10 UTC
    Thanks pg, that did exactly what I wanted. I have used conditionals in regexes before, but couldn't see the application here.

    Thanks to all the monks who replied.

    —Brad
    "A little yeast leavens the whole dough."