On Sat, Apr 23, 2011 at 7:38 PM, Roy Zuo <roylzuo / gmail.com> wrote:
> You need regex lookahead syntax
>
> ruby-1.9.2-head > str.split( /\.(?=[^=]*=)/ )
actually the lookahead can be a little simpler here, (?=.*=) does the
trick, or did I miss any particular edge case you had in mind.
Please note that [^=]*= can *always* be expressed as .*??= and often,
that is unless backtracking can occur, as .*?=.

There is an edge case in which neither of our regexen might deliver
the required result, "a.b=c.d=e", but as there is no spec, there is no
solution ;)
Cheers
Robert