I am writing a regex to support alphabets in both lower and upper case, digits, - and Unicode characters within the range 00C0-00FF.
I have seen answers explaining supporting all language characters using regex \p{L}+ but I don't want to support all language characters. I only want to support a specific range [00C0-00FF] of Unicode characters from URL https://unicode-table.com/en/blocks/latin-1-supplement/
I tested my example string O’Donnell À Ö ö Ì ÿ 012
on website https://regex101.com/ with pattern [A-Za-z0-9\x{00C0}-\x{00FF}'’\- ]{1,70}
but this pattern [A-Za-z0-9\x{00C0}-\x{00FF}'’\- ]{1,70}
doesn't work in java. May you support me for writing equivalent pattern for Java.
Sample Code I am using to test regex -
public static void main(String... args) {
Pattern p = Pattern.compile("[A-Za-z0-9\\x{00C0}-\\x{00FF}'’\\- ]{1,70}",
Pattern.UNICODE_CHARACTER_CLASS);
Matcher m = p.matcher("O’Donnell À Ö ö Ì ÿ 012");
boolean b = m.matches();
System.out.println("value=" + b);
}