I have a json string like this:
string = "{name={first=sam, last=vo}, hobbies={hobby1=football, hobby2=swimming}}"
And I want to remove the "name=" and the "hobbies=", so that I use this pattern: \w*\=(?={) ->tested using editPadPro
However, when I use the replace all in java:
String pattern = "\\w*\\=(?={)";
String removedParent = string.replaceAll(pattern, "");
I got this error message
"Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal repetition near index 7
\w*\=(?={)"
Can you please give me some advices to get this work?
Regards,
Sam