Hello,
the problem is, that your regex doesnt seach at beginning or end (for a split a not so
good idea anyway),
but it is a negated character class because of the square brackets and the circumflex
as the first character in it.
It uses any non-word character, apostrophe, '-' or '$' to split the string.
It would be easier to help you, if you tell us what exactly you want to use for split.
Michael
Am Sonntag, 13. Juli 2003 13:19 schrieb David Storrs:
> Greetings all,
>
> Given this code:
>
> my $TOKEN_DELIMS = qr/[^\w\-'\$]/;
> my $text = # string containing the contents of an mbox file
>
> my @tokens = split /$TOKEN_DELIMS/o, $text;
>
> I end up with a large number of null strings ('') in @tokens. After
> RTFMing on split, I assume this is because I am matching at the
> beginning/end of the string. I can't quite grok how to eliminate
> these, however.
>
> I can easily grep them out, but this is a time-sensitive routine, and
> I'd rather just not generate them. How can I modify my pattern (or my
> string, without losing real data), so that I don't get these spurious
> matches?
>
>
> Thanks in advance,
>
> --Dks
--
Intelligenz ist etwas, von dem die meisten Menschen verschont blieben...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]