Hi Wasted, Just try this,
#!/usr/bin/perl my $data = "Exlief 4 page : 1 /10"; if ($data =~ /pag\w+\s*:\s*(\d+)[^\d]*(\d+)/) { print "Pages : $1 / $2\n"; } my $data = "Exlief 4 page : 1 / 5"; if ($data =~ /pag\w+\s*:\s*(\d+)[^\d]*(\d+)/) { print "Pages : $1 / $2\n"; } __END__ Pages : 1 / 10 Pages : 1 / 5
Regards,
Velusamy R.
In reply to Re: Matching numbers by regex.
by Samy_rio
in thread Matching numbers by regex.
by Wasted
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |