in reply to Re: Regex Subexpressions
in thread Regex Subexpressions
Let me just add the following, since it took me a few minutes to see exactly what you were doing, as well as making it conform to the original requirements for the output:
I realized a "reverse" was necessary, and then immediately fell into the trap of putting it before the "join". I like your answer a lot for its succinct approach!$_ = "abc"; # Regex match of /.../ uses $_ when =~ is unspecified # Nicely solves the problem stated, and demonstrates list assignment # to a regex capture. # @matches = m/(((a)b)c)/ and print join "\n", reverse @matches;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex Subexpressions
by ikegami (Patriarch) on Sep 10, 2005 at 03:52 UTC |