[SOLVED]Javacript Gui textfield, check character

Hi,
I have 2 textfield on my app and i want a character restriction (a to z, A to z and 0 to 9)

I’ve seen some example of regex but only in C#.

I made this :

if (Event.current.character < "0"[0] || Event.current.character > "9"[0]) {//if not a number
       if (Event.current.character < "a"[0] || Event.current.character > "z"[0]) { //if not a<  <z
              Event.current.character = "\0"[0]; //block event
       }
}

It was working untill i put it on my android device.

I didn’t find a solution.

Thanks

Solved it:

import System.Text.RegularExpressions;

myString = Regex.Replace(myString, "[^a-zA-Z0-9éèáàçñùúí ]", "");