I want to split values like {200,200} into two strings (200 and 200), deleting the comma and brackets.
But when I try to use a standard pattern ^\{*|,|\}*$ I get an error (Illegal escape character) How I can make this split in Java?
String[] d = a.split("^\{*|,|\}*$");
In Java, you have to double the escape characters in your regular expressions:
It is because the regular expression is in a String literal and escape characters already have a meaning in String literals.