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 |