My first thought was:
$text =~ s/(?:national security adviser |dr\. |doctor |condoleeza )+ri +ce/condoleezarice/ig;
But that is not what you want. You want exact. So ... we need to get down to the tricky stuff ... ;-)
$text =~ s/(?!rice) (?:dr\.\ |doctor\ )? (?:condoleeza\ )? rice /condoleezarice/igx;
I just love trickery! :-)
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
In reply to Re: Non-exclusive or in regexp?
by Sidhekin
in thread Non-exclusive or in regexp?
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |