I’m trying to remove the comma that occurs in
[,{
I’ve tried two things here with lookbehind and lookahead –
The first is
"(?=\\[),(?=})"
and the second is putting (?=[),(?=}) in side Pattern.quote().
I then do a String.replaceAll(regex,"") , but it does not work.
Where am I going wrong with lookaround?
No need for look-ahead/behind, just use:
str.replaceAll("\\{,\\[", "{[");.