in reply to (dooberwah) I'm don't think that gives the same results
in thread Regular Expression Tweaking
#!/usr/bin/perl -wT use strict; # Replace 'See' anywhere in the string $_ = "See spot run. See spot jump."; s/See/MATCH/g; print "'$_'\n"; # 'MATCH spot run. MATCH spot jump.' # Replace 'See' unless lookahead finds the anchor $_ = "See spot run. See spot jump."; s/(?!^)See/MATCH/g; print "'$_'\n"; # 'See spot run. MATCH spot jump.' # Replace 'See' unless lookabehind finds the anchor $_ = "See spot run. See spot jump."; s/(?<!^)See/MATCH/g; # 'See spot run. MATCH spot jump.' print "'$_'\n";
-Blake
|
|---|