Reputation: 2265
I'm trying to split a string by single quotes, but taking into account that a repeated single quote represents a escaped quote. So for example the following string
String ss ="aaa''bbb'ccc''ddd'eee";
would be splitted in
aaa''bbb
ccc''ddd
eee
so the regular expression should be something like "Any single quote that is not preceded by a single quote and its not followed by a single quoted". The expression to avoid the single quote not followed by a single quote is simple:
String regexp= "'(?!')";
But I was unable to apply the condition "not preceded by a single quote". Any ideas?
TIA
JL
Upvotes: 3
Views: 528