while(<DATA>) { s/(?<!the )fox(?!.*fox)/the fox/ ; print; } __DATA__ the fox comes and fox goes into forest fox comes and fox goes into forest the fox comes and the fox goes into forest fox comes and the fox goes into forest
In reply to Re^2: regexp find last word
by manav
in thread regexp find last word
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |