If i try to match a regex string with diacritics (something along the lines of ^[a-zA-Z0-9áàAÁÁ ]{0,100}$) it will match Báhhh on the server side (i call the same validation twice) but will fail on the client side. I already changed the enconding of the java class, but it still doesn’t match.
Is there a special gwt regex class for diacritics or am i missing something?
Strange, as
/^[a-zA-Z0-9áàAÁÁ ]{0,100}$/.test('Báhhh')returnstruefor me in Chrome’s JS console.I suspect it’s a Unicode issue, where
ácan be coded in several ways: U+0061 U+0301, U+0061 U+0341, or U+00E1.Maybe try
/^(?:[a-zA-Z][\u0301\u0341]?|[áàÁÁ0-9 ]){0,100}$/