Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: help related to regular expression

by lidden (Curate)
on Mar 04, 2010 at 07:56 UTC ( #826642=note: print w/replies, xml ) Need Help??


in reply to help related to regular expression

I do not know if I understand your question correctly. If you want to match a 'p' followed by some digits you can do it like this.

my $string = 'p23'; if($string =~ /[pP](\d+)/){ print $1 }'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2023-12-11 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?