I assume that you really want to match two digits.
$variable = "-----;=99;helloworld"; if ($variable =~ /(\d\d)/) { # $1 contains 99 }
The parentheses in the regex mark the parts that you want to capture.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: Reg ex question
by davorg
in thread Reg ex question
by costas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |