Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Perl 6 Summary for 2004-11-08 through 2004-11-15

0 views
Skip to first unread message

Joe Gottman

unread,
Nov 15, 2004, 11:41:11 PM11/15/04
to perl6-l...@perl.org

> -----Original Message-----
> From: Matt Fowles [mailto:uber...@gmail.com]
> Sent: Monday, November 15, 2004 11:27 PM
> To: perl6-a...@perl.org; Perl 6 Internals List; perl6-
> lang...@perl.org; perl6-c...@perl.org
> Subject: Perl 6 Summary for 2004-11-08 through 2004-11-15
>
> Perl 6 Summary for 2004-11-08 through 2004-11-15
> matching the nth occurrences
> Sudarshan Gaikaiwari wanted to know how to match the "2nd last" last
> occurrence in Perl6 rules. I think the message might have been posted
> directly to google groups, as I did not get it in my email and nobody
> replied. The example given matches the 2nd occurrence. As I am not
> sure
> what is meant by "2nd last", I will answer the question I do know.
> "m:2nd/foo/" will match the second occurrence of foo. The nth
> occurrence
> can be accessed similarly.

I believe that the OP wanted to know how to match the second-to-last
occurrence. So if we were to do something like
m:nth(-2)/foo/ # just a guess about the syntax.
on a string containing 4 foo's, then this would match the third foo.

Joe Gottman


0 new messages