Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我有更好的正则: 中文姓名 #294

Open
fank243 opened this issue Jul 16, 2023 · 6 comments
Open

我有更好的正则: 中文姓名 #294

fank243 opened this issue Jul 16, 2023 · 6 comments

Comments

@fank243
Copy link

fank243 commented Jul 16, 2023

可否考虑增加一个百家姓的正则?
之前开发一个需求从一段文字中提取所有姓名字段,如果单纯汉字匹配,还是歧义很大。
超出百家姓以外的,只需要手动添加下。

^(|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||羿||||||||||||||||||||||||||||||||||||||||||||||||||||||||宿||怀||||||||||||||||||||||||||||||||||||||||||寿||||||||||||||||||||||||||||||||||||||||||||||广|||||||||||||||||||||||||||||||||||||||||||||||||||万俟|司马|上官|欧阳|夏侯|诸葛|闻人|东方|赫连|皇甫|尉迟|公羊|澹台|公冶|宗政|濮阳|淳于|单于|太叔|申屠|公孙|仲孙|轩辕|令狐|锺离|宇文|长孙|慕容|鲜于|闾丘|司徒|司空|丌官|司寇|||子车|颛孙|端木|巫马|公西|漆雕|乐正|壤驷|公良|拓拔|夹谷|宰父|谷梁||||||||段干|百里|东郭|南门|呼延|||羊舌|微生|||||||||梁丘|左丘|东门|西门|||||||南宫|||||||||第五||).[\u4e00-\u9fa5]{0,2}$
@yz0812
Copy link

yz0812 commented Aug 16, 2023

什么场景才会用到这么严格的校验

@any86
Copy link
Owner

any86 commented Aug 28, 2023

收到。 感谢分享

@WuYunlong
Copy link

中文姓名这样判断是有问题的
我的朋叫 古丽米热·艾比布力 身份证就是这样
这样的正则就错误了吧

@any86
Copy link
Owner

any86 commented Sep 12, 2023

收到, 身份证上就带"."啊?

中文姓名这样判断是有问题的 我的朋叫 古丽米热·艾比布力 身份证就是这样 这样的正则就错误了吧

@WuYunlong
Copy link

收到, 身份证上就带"."啊?

中文姓名这样判断是有问题的 我的朋叫 古丽米热·艾比布力 身份证就是这样 这样的正则就错误了吧

不是 . 是中文的 ·

@any86
Copy link
Owner

any86 commented Sep 12, 2023

@WuYunlong 收到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants