Q:

Regular expression to split by a specific occurrence of a token while ignoring other occurrences

I have a string like this : 
String foo = "James Padolsky , Jimmy\\,Hoffa , Jane"

A regular split with , will result in Jimmy\,Hoffa being split too.
So it will be

James Padolsky 
Jimmy\
Hoffa
Jane

What I need is 

James Padolsky 
Jimmy\,Hoffa
Jane

So the regex should ignore \, and only split by ,
What regular expression will give me the above split ?

A:

You can use a negative lookbehind:
(?<!\\),

As a Java string, that would be "(?<!\\\\),".

