Ruby Split By Part of a Regex -


i have write argument parser, passed in string ala {a, b, c} delimiter comma space after it, can escaped pipe "|" before it. thinking of writing regex /[^\|], / split by, , removing escape characters afterwards. when using split character before delimiter well.

how should go accomplishing i'm looking for?

if you're on version 1.9 of ruby, can split on /(?<!\|),/.

(?<!\|) negative lookbehind assertion meaning "ensure previous character not |".


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

java - How can I customize the render of JRadioButton? -

What tools exist to convert a Delphi 7 application to C# and the .Net framework? -