in reply to Regex failure interpretation
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex failure interpretation
by BrowserUk (Patriarch) on Mar 20, 2004 at 00:40 UTC | |
by tachyon (Chancellor) on Mar 20, 2004 at 00:45 UTC | |
by BrowserUk (Patriarch) on Mar 20, 2004 at 00:52 UTC |