How about this?
use strict; use warnings; use Data::Dumper; my $post = "Hi, erm does anyone know how to do a string replacement th +at caters for all the following scenario? 500 changes to 000 or 0 988 + changes to 000 or 0 1210 changes to 1000 1300 changes to 1000 2134 c +hanges to 2000 2500 changes to 2000 Thanks in advance."; my %replacement = $post =~ /(\d+) changes to (\d+)/g; print Dumper \%replacement;
In reply to Re^3: String regex replacement
by hdb
in thread String regex replacement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |