jaiieq has asked for the wisdom of the Perl Monks concerning the following question:
Say I have the following string: AAABCDAAADCBAAABBDAAA
I need to extract all instances of AAA(anything)AAA, so I used the following to try and do that:
my $string = 'AAABCDAAADCBAAABBDAAA'; my @matches = $string =~ /AAA\w+AAA/g;
The only result returned is the full string, whereas I need...:
Any ideas?AAABCDAAA AAADCBAAA AAABBDAAA AAABCDAAADCBAAA AAADCBAAABBDAAA AAABCDAAADCBAAABBDAAA
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl Pattern Matching & RegEx's
by choroba (Cardinal) on Mar 07, 2013 at 14:29 UTC | |
by jaiieq (Novice) on Mar 07, 2013 at 14:45 UTC | |
by Dallaylaen (Chaplain) on Mar 07, 2013 at 15:34 UTC | |
Re: Perl Pattern Matching & RegEx's
by Dallaylaen (Chaplain) on Mar 07, 2013 at 14:16 UTC | |
by jaiieq (Novice) on Mar 07, 2013 at 14:23 UTC | |
Re: Perl Pattern Matching & RegEx's
by Athanasius (Archbishop) on Mar 07, 2013 at 14:28 UTC | |
Re: Perl Pattern Matching & RegEx's
by Anonymous Monk on Mar 07, 2013 at 14:00 UTC | |
by Anonymous Monk on Mar 07, 2013 at 14:04 UTC |
Back to
Seekers of Perl Wisdom