RosettaCodeData/Task/Regular-expressions/Perl/regular-expressions-4.pl
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

4 lines
144 B
Perl

$string = "I am a string";
if ($string =~ s/\bam\b/was/) { # \b is a word border
print "I was able to find and replace 'am' with 'was'\n";
}