|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
Re: Re: Re: Bother (Re: Re: Split and empty strings)by chromatic (Archbishop) |
| on Apr 10, 2001 at 20:44 UTC ( [id://71487]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
* matches 'zero or more' items. Your results are consistent with that.
From the start of the string, first the regex encounters 'The quick'. That's zero or more elements followed by a \n. Next, it finds zero or more characters between the end of the previous chunk and the \n -- that is, zero characters. So that's also a match. Because there's another \n after the first, there's also a match for the zero non-newlines between the two newlines. It continues in that fashion. That's the problem with dot-star -- if you ask it to match nothing, it will happily match all nothings, even those you don't normally see.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||