Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: extraction using regular expression

by jethro (Monsignor)
on Aug 08, 2011 at 12:31 UTC ( [id://919208]=note: print w/replies, xml ) Need Help??


in reply to extraction using regular expression

my ($number)= $searchstring=~/\|M\|\(avp-code = 268\)\(flags = 64\)\] += (\d+)/; #or my ($number)= $searchstring=~/\Q|M|(avp-code = 268)(flags = 64)]\E = ( +\d+)/;

The only difficult part is escaping all the characters that have a special meaning in regexes. Easier to use \Q\E to do that automatically

Replies are listed 'Best First'.
Re^2: extraction using regular expression
by shrawansher (Novice) on Aug 16, 2011 at 05:27 UTC
    thanks.i was getting stuck with the \issue.sorry for the bother though.realised it was kind of a trivial question.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-26 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found