
lmmilewski
Novice
Nov 3, 2008, 1:27 AM
Post #3 of 4
(388 views)
|
|
Re: [shawnhcorey] /^((-*)|(\s*))$/ aahhh
[In reply to]
|
Can't Post
|
|
Shouldn't it be
$something =~ / ^ # start at beginning of the string ( # capture var $1 ( # capture var $2 -* # zero, one, or more '-' ) # end capture var $2 | # alternative pattern if -* fails ( # capture var $3, again \s* # zero, one, or more white space ) # end capture var $3 ) # end capture var $1 $ /x; # end of string There is $3 instead of $2. I checked that on simple example.
foreach (<STDIN>) { m/^((-*)|(\d*))$/; print "[$1,$2,$3]\n"; } For input:
------------ 9999999999 I got
[------------,------------,] [9999999999,,9999999999] Am I missing something? -- Łukasz Milewski
|