> On Monday, December 15, 2003 03:05, John W. Krahn wrote: > > >Here is a little quiz for you beginners out there. split() treats its > >first argument as a regular expression. There are TWO exceptions where > >the first argument does not behave the same as a normal regular > >expression. What are they? > > The first one that comes to mind is using // for your search. Rather than > repeating the last search, it searches for the null string to split on. > > The second one is if you include parentheses in your regex. If you put > parentheses around your regex, then split will create entries for each of > the matched terms in addition to the just the "splitted" items. > > So, do I win a prize or something? :) >
But parentheses are normal in a regex, though granted the return is odd. I would guess as the second the special case where ' ' is passed and the string is split on whitespace which is not interesting, but where leading space is skipped? http://danconia.org -- Boycott the Sugar Bowl! You couldn't pay me to watch that game. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>