in reply to Find and extract substring(s) within larger string.
You need to call the /g -modified regex in list context:
13:42 >perl -wMstrict -e "my $dna = 'xxxxxxpecbcbccrlxxxxxxpeeeerlxxxx +xplxxxxxPeRLxxxx'; my @matches = $dna =~ /(p.*?l)/gi; print qq[$_\n] +for @matches;" pecbcbccrl peeeerl pl PeRL 13:42 >
See “Global Matching” in Using regular expressions in Perl.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find and extract substring(s) within larger string.
by Anonymous Monk on Oct 21, 2013 at 04:14 UTC | |
by Athanasius (Archbishop) on Oct 21, 2013 at 04:41 UTC | |
by Anonymous Monk on Oct 21, 2013 at 04:51 UTC | |
by AnomalousMonk (Archbishop) on Oct 21, 2013 at 23:37 UTC |