Apr 9, 2010, 12:52 AM
Post #4 of 5
In your regexp, you use grouping (parentheses; see the perlre man-page) to capture the patterns you are interested in. Then you have two possibilities:
Re: [zerysaish] storing match into other scalar
[In reply to]
(1) If you evaluate the pattern match in list context, i.e.
@s=$x =~ /...(....)....(....)..../
the result contains the parts of the string which match the groups. This is discussed in the perlop man-page (scroll
forward to the section "Regexp Quote-Like Operators").
(2) You can pick up $1, $2 etc. after the match.