Good morning,
I have this small question: I'm trying to extract a match from a text of the type "expression1 expression2 expression3".
I'm doing sucessfully this with an array. @source = $text =~ m/(regex1)(regex2)(regex3)/g; The values are kept in $source[0],$source[1] and $source[2].
The problem is that expression2 might repeat itself 1, 2 or more times. So I'm using @source = $text =~ m/(regex1)(regex2)+(regex3)/g; But when I try to access $sources[1], I get the last match of the possible repetitions of expression2, not all... I've tryed a simple print "$sources[1]" and even a "$sources[1][0] sources[1][1]" Can someone please tell me what I'm doing - obviously - wrong?
Kind regards,
Kepler
In reply to Regex troubles... by kepler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |