My Aim: I want to check whether a Java string contains characters from GSM Extended. The existing code successfully checks for GSM characters, but I am struggling to grasp how to check for GSM Extended characters such as '[' and ']'.
My Code:
private static final String GSM_EXTENDED = "\u000c^{}\\[~]|\u20ac";
public static boolean isUnicode(String input) {
return !((input.matches('[' + GSM + "]*")) || (input.matches('[' + GSM_EXTENDED + "]*")));
}
Result: My unit tests don't recognise ']' as GSM Extended, and furthermore, when any GSM Extended character is typed in from the GUI, they are not recognised as GSM.