Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Matching numbers by regex.

by Samy_rio (Vicar)
on Apr 19, 2006 at 09:56 UTC ( #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
Node Status?
node history
Node Type: note [id://544309]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2018-02-24 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (310 votes). Check out past polls.

    Notices?