正则表达式匹配除数字外的希伯来语和英语字符
问题描述:
我有一个问题:我想用 RegEx 对名字和姓氏进行验证.我只想用没有数字的希伯来语和英语来做.有人可以帮我做那个代码吗?
I have a question: I want to do a validation for the first and the last name with RegEx. I want to do it with only Hebrew and English without numbers. Someone can help me to do that code?
答
看似希伯来语的范围是 \u0590-\u05fe
(根据 这个不错的 JavaScript Unicode 正则表达式生成器`.
Seemingly Hebrew has the range \u0590-\u05fe
(according to this nice JavaScript Unicode Regex generator`.
/^[a-z\u0590-\u05fe]+$/i