i"m trying to fint if a string starts(first letter) width an RTL language/ hebrew.
any ideas?
i"m trying to fint if a string starts(first letter) width an RTL language/ hebrew.
any ideas?
JavaScript does not support regex scripts like \p{InHebrew} (or something similar). However, it does support Unicode escapes, so you could use a regex like:
/[\u0590-\u05FF]/
which will match a single Hebrew character.
See: http://unicode.org/charts/PDF/U0590.pdf and: http://www.regular-expressions.info/unicode.html
if (str.charCodeAt(0) >= 0x590) && (str.charCodeAt(0) <= 0x5FF) then it is considered a hebrew character