in reply to In need of a stupid regex trick

IOW, you wish to split iff there are an even number of quotes since the start of string.

/(?<^[^"]*("[^"]*"[^"])*) / does not work: perl states that

Variable length lookbehind not implemented before HERE mark in regex

lookahead works, but. and the following code:

my @a = ( 'simple', 'keep simple', 'a "bit more" difficult', 'an "increasing more" "and more" here'); foreach $_ (@a) { s/ (?=("[^"]*"[^"])*[^"]+$)/ | /g; print "$_\n"; }
produces
simple keep | simple a | "bit more" | difficult an | "increasing more" | "and more" | here

unfortunately, the regex "confuses" split and it's not usable, at least i was not able to. but why? :)