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("\\{,\\[", "{[");.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With