We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
which works perfectly:
use strict; my $string='foo1bar'; print "BEFORE: [$string]\n"; $string =~ s/(.*)\d/$1---/; print "AFTER: [$string]\n";
But that did not work as I hoped:
use strict; my $string='foo1bar'; my $search='(.*)\d'; my $replace='$1---'; print "BEFORE: [$string]\n"; $string =~ s/$search/$replace/; print "AFTER: [$string]\n";
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Regular Expression to find values of a certain lenght||1||36|
|Regular Expression 1-100 with two digits||15||80|
|How do I write a Regex to only flag the last four characters of a string||2||26|