when I try to pull out 81 from the string A81, it doesn't do what I expected
my $digits = $string2 =~ /(\d)+/;
The modifier + is outside the parentheses so it will only match a single \d character multiple times. To match multiple \d characters the modifier has to be applied directly to the pattern: /(\d+)/.
In reply to Re: assigning regex matches to variables
by jwkrahn
in thread assigning regex matches to variables
by genghis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |