It's all in the regular expression you pick.  Perl5Compiler does not
currently support lookbehind assertions, which off the top of my head
is the only way I can see to do what you want.  I'm assuming you want to
split on all occurrences of | not preceded by /.  This requires context,
which is a parsing, not a tokenization, problem, which typically cannot
be handled by regular expressions alone.   Even though Perl regular
expressions have gotten progressively more powerful (and convoluted),
in general, regular expressions can only do so much and you have to write
extra parsing code to suit the situation.

In message <31B95AE31DF0D311A25200805F857D471C0F27@Pulinco_1>, Markus Schlegel 
writes:
>OK, right, I missed that.
>But anyway, is there a way to use Util.split() such that
>"foo|bar" results in {"foo","bar"}
>and
>"foo/|bar" results in {"foo/|bar"}
>?
>
>I wrote my own split-method for now, which uses the above pattern and looks
>if the first char of the match is a slash or not. Not very pretty...
>
>Thanks
>
>
>Markus Schlegel
>Dipl. Ing. Wirtschaftsinformatik HTL,
>Software Engineer
>_________________________________________
>
>pulinco ag
>Webergutstrasse 4, 3052 Zollikofen, Switzerland
>Tel: +41 (0)31 910 44 44
>Fax: +41 (0)31 910 44 49
>[EMAIL PROTECTED]
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to