I have multiple strings for some languages(english, italian, arabic, french ...etc). I want to see a list of words other than that language's alphabet.
For example for English:
"thisŞĞstring" -> return false
"corect string format" -> return true
For example for Arabic:
"كلمةabc" -> return false
"كلمة" -> return true
I don't want to enter the alphabet of all languages one by one. Is there a way to do what I want?
It is not quite what you’re looking for, but regex has the ability to find letters that do not conform to a particular script, e.g.:
Or if you use
[\p{Letter}--\p{script=arabic}]+
with “كلمةabc”, it will return “abc”.Again, likely not quite what you are looking for, but you can use
NaturalLanguage
framework to parse text:Returning:
Or if you use
.script
inenumerateTags
: