in reply to Regex Matching Oddity
Here's what explain has to say:print "japhy" =~ /(.)+/; # prints 'y' ONLY
---------------------------------------------------------------------- ( group and capture to \1 (1 or more times (matching the most amount possible)): ---------------------------------------------------------------------- . any character except \n ---------------------------------------------------------------------- )+ end of \1 (NOTE: because you're using a quantifier on this capture, only the LAST repetition of the captured pattern will be stored in \1)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex Matching Oddity
by AidanLee (Chaplain) on Jun 27, 2001 at 22:01 UTC | |
by japhy (Canon) on Jun 27, 2001 at 22:08 UTC |