w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
RegEx check for Spanish Characters

What about allowing all letters in all languages? There is Unicode and you can match for Unicode characters with certain properties.

For letters there is the property p{L}.

You can use this as it is in regex:

  • p{L}+ to match a sequence of letters

  • [p{L}_]+ in a character class

There are also Unicode scripts and blocks, that define a certain subset of Unicode characters/letters, maybe that is more what you want, e.g. p{Greek} or p{Cyrillic}. I don't know what would be the subset for spanish.

For some more details see e.g.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.