From: Michael Schuerig Date: 2005-09-29T00:16:45+09:00 Subject: Re: Splitting a string with escapable separator? Gavin Kistner wrote: [snip] > Note that the above does not account for the case of: > Hello \\,World > (where an escaped backslash is intended to end the first entry) > but if that was important, that's just a matter of a bit of odd/even > backslash counting. That's a thing I'd need. Opportunistically, I'll go with William's suggestion from a sibling post. > Something like (untested): > re = /(.+?)(?:#{escape_char ? "([^\\#{escape_char}](\\#{escape_char}\ > \#{escape_char})*)" : ''}#{separator}|$)/ Thanks. Michael -- Michael Schuerig The more it stays the same, mailto:michael@schuerig.de The less it changes! http://www.schuerig.de/michael/ --Spinal Tap, The Majesty of Rock