I have an input field which is localized. I need to add a validation using a regex that it must take only alphabets and numbers. I could have used [a-z0-9]
if I were using only English.
As of now, I am using the method Character.isLetterOrDigit(name.charAt(i))
(yes, I am iterating through each character) to filter out the alphabets present in various languages.
Are there any better ways of doing it? Any regex or other libraries available for this?