> -----Original Message-----
> From: Matt Fowles [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 15, 2004 11:27 PM
> To: [EMAIL PROTECTED]; Perl 6 Internals List; perl6-
> [EMAIL PROTECTED]; [EMAIL PROTECTED]
> 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