Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
I am using the following to perform substitutions in a text:
$text =~ s/\'t/ \'t/g;It basically adds a white space before 't. Now I want to add some exceptions to this matching rules: with "aren't" and "isn't" the regex shouldn't match, in all other cases yes. It is possible to achieve this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substitution with exceptions
by LanX (Saint) on Sep 27, 2018 at 19:17 UTC | |
by choroba (Cardinal) on Sep 27, 2018 at 19:27 UTC | |
by LanX (Saint) on Sep 27, 2018 at 19:45 UTC | |
by haukex (Archbishop) on Sep 27, 2018 at 19:31 UTC | |
by Anonymous Monk on Sep 27, 2018 at 20:08 UTC | |
|
Re: substitution with exceptions
by AnomalousMonk (Archbishop) on Sep 27, 2018 at 21:40 UTC |