in reply to Regex Matching Oddity

$ perl -lwe'print join" > ",m#(?:^rs://|\.)([-\w]+)#g for qw(rs://b.c rs://d.e.f rs://g.h.i.j.k)' b > c d > e > f g > h > i > j > k $
I kinda expected this would work:(m|^rs://([-\w]+)|g, m|\G\.([-\w]+)|g)update: even though this does:m|^rs://([-\w]+)|, m|\.([-\w]+)|gWhy isn't the pos() set?

  p

Replies are listed 'Best First'.
Re: Re: Regex Matching Oddity
by AidanLee (Chaplain) on Jun 27, 2001 at 22:07 UTC

    I approached this the way i did because I thought it kind of reminded me a bit of BNF:

    pattern: 'rs://' token [ '.' token ]+ token: [-\w]+