Syntax error. You ask for one char, you get one char. The + needs to be within the capture and then it works as advertised.
$_ =~ m[^([01]+)$] and print "$_:'$1'\n" for qw[ 0 1 00 11 10 01 012]; __DATA__ 0:'0' 1:'1' 00:'00' 11:'11' 10:'10' 01:'01'
cheers
tachyon
In reply to Re: Regex failure interpretation
by tachyon
in thread Regex failure interpretation
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |