At 05:11 PM 9/27/05 -0700, $Bill Luebkert wrote:
>\s* means to grab any WS at the current position (including the case where
>    there is none).
>
>\s*? means 0 or 1 of the above which is totally meaningless - you've already
>    eaten all the WS with the \s*, so in my opinion the ? is redundant to
>    what you have already done.

Redundant vs. Useless!  Semantic battle of the century!!  Who's right and
who's wrong: and will be put to DEATH!

Redundant:
m/\s*\s/;       # Specifying something again when it was already specified

Useless:
m/xyz\s*?$/;    # Specifying something that does nothing

* maximal match, eat up as many characters as possible to make the overall
expression match
*? minimal match, eat up as few characters as possible to make the overall
expression match

That rule doesn't disappear just because a certain character sequence was
specified.  *? is only *useful* when used with wildcards since it will decay
to a nul if used with a fixed string.  The minimum of the range 0 to inf is 0.





--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  • Re: Regex Chris Wagner

Reply via email to