I'm an absolute beginner on learning RegEx. I need to split a string into it's different Substrings, based on multiple conditions.
String:
"abc","def",NULL,"ghi",NULL,"jkl"
should be splitted to
[abc, def, NULL, ghi, NULL, jkl]
Currently I'm using String[] split = line.split("\",\"");
to generate all substrings which are enclosed within "..." and seperated by ,. This works fine, but if there is a NULL value (which is not enclosed by "..."), the substrings are splittet incorrect.
Is it possible to split the String into it's Substrings by using a RegEx which splits the String if one of the following conditions is given?
- ","
- L,"
- ",N
Thanks in advance!