Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Matching numbers by regex.

by Samy_rio (Vicar)
on Apr 19, 2006 at 09:56 UTC ( [id://544309]=note: print w/replies, xml ) Need Help??


in reply to Matching numbers by regex.

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.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://544309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-29 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found