in reply to Re^2: simple regex question
in thread simple regex question
am i correct in assuming if we were setting $1, $2 etc. /regexstuff/ will return $1 . $2?
No, but why guess? Here's the relevant section of perlop:
m/PATTERN/cgimosx
/PATTERN/cgimosx
Searches a string for a pattern match, and in scalar context returns true if it succeeds, false if it fails.
...
If the "/g" option is not used, "m//" in list context returns a list consisting of the subexpressions matched by the parentheses in the pattern, i.e., ($1, $2, $3...). ... When there are no parentheses in the pattern, the return value is the list "(1)" for success. With or without parentheses, an empty list is returned upon failure.
the lowliest monk
|
|---|