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
In reply to Re: extraction using regular expression
by jethro
in thread extraction using regular expression
by shrawansher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |