[Melbourne-pm] Fwd: How to parse n matches out of a string?

Nathan Bailey web at polynate.net
Sun Mar 27 02:52:23 PDT 2016


Thanks all - much more elegant :-)
-N

On 27 March 2016 at 01:58, Shlomi Fish <shlomif at shlomifish.org> wrote:

> Hi all,
>
> On Sat, 26 Mar 2016 22:30:09 +1100
> Damian Conway <damian at conway.org> wrote:
>
> > Nathan Bailey <web at polynate.net> asked:
> >
> > > Is there a 'best practice' idiom for parsing out multiple matches from
> a
> > > string?
> > >
> >
> > my @matches =  $string =~ m{ (Match) }gx;
> >
> > HTH,
> > Damian
>
> One should also note that one can use the /g regex-modifier in scalar
> context in conjuction with pos , /c , etc. For some more comprehensive
> pages
> about that and other methods of parsing text, see:
>
> * http://perl-begin.org/uses/text-parsing/
>
> * http://perl-begin.org/topics/regular-expressions/
>
> (Note: I originated http://perl-begin.org/ and I still maintain it.)
>
> Regards,
>
>         Shlomi Fish
>
> --
>
> Give me ASCII or give me deaþ!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20160327/7636961e/attachment.html>


More information about the Melbourne-pm mailing list