XP is just a number | |
PerlMonks |
Re^2: Regex's, parentheses, and the mysterious ( ??{ } ) operatorby Clovis_Sangrail (Beadle) |
on Jul 12, 2013 at 15:35 UTC ( [id://1044004]=note: print w/replies, xml ) | Need Help?? |
Laurent R: "the $stuff variable is not the same in the two programs:" I must've done that after I copied one program to the other, but it does not matter, in both programs that area is inside the first pair of parenthesis, and it gets included in the match. Anonymous Monk: "I think you have one too many $parens..." I do not know how to say what the problem is any differently. I *want* to use $paren a second time and have it find the *second* separate parenthesized text string within the $stuff variable, and set the $2 regex memory variable equal to it. The regex defined in the variable $paren is set works, it successfully finds the first open '(' and balancing close ')' pair of parenthesis. Because I use it as:
It sets the matching text to the $1 variable. How come I cannot use it again, via something like:
The sample $stuff variable does have a second, separate parenthesized text string in it ( "(for a while)" ) how come the same $paren regex does not find that second parenthsized string and set $2 to it?
In Section
Seekers of Perl Wisdom
|
|