+ Start a Discussion
Novice2Novice2 

Regex Hex-Range works for ISO-8859-1 but not for Windows-1252/CP-1252 chars?

---------------------------------------------------
Ref: http://en.wikipedia.org/wiki/ISO/IEC_8859#Table
 ASCII Extended ISO-8859-1/ISO-Latin-1 Western European

System.debug('RegexTest Pattern.matches exp:\\xA0-\\xFF str:äöüßÄÖÜ: ' + Pattern.matches('[\\xA0-\\xFF]+', 'äöüßÄÖÜ'));
USER_DEBUG [1]|DEBUG|RegexTest Pattern.matches exp:\xA0-\xFF str:äöüßÄÖÜ: true

------------------------------------------------------------------
Ref:   http://en.wikipedia.org/wiki/Windows-1252
 ASCII Extended Windows-1252/CP-1252
Hex, Hex Range:
x91-x9C  ‘ ’ “ ” • – — ˜ ™ š › œ

System.debug('RegexTest Pattern.matches exp:\\‘\\’\\“\\” str:‘’“”: ' + Pattern.matches('[\\‘\\’\\“\\”]+', '‘’“”'));
USER_DEBUG [1]|DEBUG|RegexTest Pattern.matches exp:\‘\’\“\” str:‘’“”: true

System.debug('RegexTest Pattern.matches exp:\\x91-\\x9C str:‘’“”: ' + Pattern.matches('[\\x91-\\x9C]+', '‘’“”'));
USER_DEBUG [1]|DEBUG|RegexTest Pattern.matches exp:\x91-\x9C str:‘’“”: false

Thank you in advance.