Java Question [SOLVED] Help with REGEX

Johan Schoeman

Expert
Licensed User
Longtime User
I am not familiar with REGEX. Need to convert the following to a string that SLC will be happy with:
B4X:
public static final String GSM_CHARACTERS_REGEX = "^[A-Za-z0-9 ?ĄÄÖŃܧżäöńüŕ^{}\\\\\\[~\\]|\u20AC]*$";[/CODE">\\r\\n@Ł$ĽčéůěňÇŘřĹĺ\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039EĆćßÉ!\"#$%&'()*+,\\-./:;<=>?ĄÄÖŃܧżäöńüŕ^{}\\\\\\[~\\]|\u20AC]*$";

Will appreciate it is someone could assist.....

When compiling with SLC I get the following error:
B4X:
Starting step: Compiling Java code.
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
C:\Users\----------2\Documents\Basic 4 Android\smsmms\smsmms\smsmms\library\src\com\klinker\android\send_message\Utils.java:52: error: unmappable character for encoding Cp1252
    public static final String GSM_CHARACTERS_REGEX = "^[A-Za-z0-9 \\r\\n@Å?$ĽÄ?éůěňÇŘřĹĺ\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039EĆćßÉ!\"#$%&'()*+,\\-./:;<=>?ĄÄÖŃܧżäöńüŕ^{}\\\\\\[~\\]|\u20AC]*$";
                                                                           ^
C:\Users\----------2\Documents\Basic 4 Android\smsmms\smsmms\smsmms\library\src\com\klinker\android\send_message\Utils.java:52: error: unmappable character for encoding Cp1252
    public static final String GSM_CHARACTERS_REGEX = "^[A-Za-z0-9 \\r\\n@Å?$ĽÄ?éůěňÇŘřĹĺ\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039EĆćßÉ!\"#$%&'()*+,\\-./:;<=>?ĄÄÖŃܧżäöńüŕ^{}\\\\\\[~\\]|\u20AC]*$";
                                                                                ^

Error.

From a previous post by @Erel I know I can get the Unicode characters from here http://unicode.scarfboy.com/?s=Ł
....but I am battling to get the string correct
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hello,
How did you fix this issue ?

Thanks.
B4X:
public static final String GSM_CHARACTERS_REGEX = "^[A-Za-z0-9 \\r\\n@\u0141$\u013D\u010D\u00E9\u016F\u011B\u0148\u00C7\u0158\u0159\u0139\u013A\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039E\u0106\u0107\u00DF\u00C9!\"#$%&'()*+,\\-./:;<=>?\u0104\u00C4\u00D6\u0143\u00DC\u00A7\u017C\u00E4\u00F6\u0144\u00FC\u0155^{}\\\\\\[~\\]|\u20AC]*$";
 
Top