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? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -