It's pretty trivial to split a key:value pair with a regular expression. Something like /^\s*([^:]+)\s*:\s*(.*?)\s*$/ can do the job. But how can you do it if you want to allow escaped colons in your key?
Say you allow the escapes "\\" → '\' and "\:" → ':' in your key. Is there any way to use a regular expression to split the key and value while ignoring a "\:"? Keep in mind that that could actually be "\\:" in which case you still should split on that colon because it's actually the backslash that's escaped. So, a simple one character lookbehind isn't sufficient.
Any solutions?
new⇒Spider solitaire
I have now won, at the "Difficult"level, 186 games of SpiderSolitaire. I...
75.179.28.113: Oct 13, 9:34am