简体   繁体   English

如何在正则表达式中使用标点符号检测汉字?

[英]How to detect Chinese character with punctuation in regex?

I have noticed that there are question asked on how to detect Chinese character with regex.我注意到有人问如何用正则表达式检测汉字的问题。 These are some question I read on stackoverflow:这些是我在stackoverflow上阅读的一些问题:

Php check if the string has Chinese chars PHP检查字符串是否包含中文字符

detecting chinese characters in php string 在php字符串中检测汉字

And some article outside stackoverflow:在stackoverflow之外还有一些文章:

http://www.regular-expressions.info/unicode.html - unicode script http://www.regular-expressions.info/unicode.html-Unicode脚本

Basically they suggest using either \\p{Han}+ or [\\x{4e00}-\\x{9fa5}]+.* to detect Chinese character.基本上,他们建议使用\\p{Han}+[\\x{4e00}-\\x{9fa5}]+.*来检测汉字。 Is there a way to detect Chinese punctuation mark as well?有没有办法检测中文标点符号?

Some example (but not all) of Chinese punctuation mark: :?。,《》「」『』-()【】一些(但不是全部)中文标点符号:??。,《》「」『』-()【】

I have noticed that there are question asked on how to detect Chinese character with regex.我注意到有人问如何用正则表达式检测汉字的问题。 These are some question I read on stackoverflow:这些是我在stackoverflow上阅读的一些问题:

Php check if the string has Chinese chars PHP检查字符串是否包含中文字符

detecting chinese characters in php string 在php字符串中检测汉字

And some article outside stackoverflow:在stackoverflow之外还有一些文章:

http://www.regular-expressions.info/unicode.html - unicode script http://www.regular-expressions.info/unicode.html-Unicode脚本

Basically they suggest using either \\p{Han}+ or [\\x{4e00}-\\x{9fa5}]+.* to detect Chinese character.基本上,他们建议使用\\p{Han}+[\\x{4e00}-\\x{9fa5}]+.*来检测汉字。 Is there a way to detect Chinese punctuation mark as well?有没有办法检测中文标点符号?

Some example (but not all) of Chinese punctuation mark: :?。,《》「」『』-()【】一些(但不是全部)中文标点符号:??。,《》「」『』-()【】

I have noticed that there are question asked on how to detect Chinese character with regex.我注意到有人问如何用正则表达式检测汉字的问题。 These are some question I read on stackoverflow:这些是我在stackoverflow上阅读的一些问题:

Php check if the string has Chinese chars PHP检查字符串是否包含中文字符

detecting chinese characters in php string 在php字符串中检测汉字

And some article outside stackoverflow:在stackoverflow之外还有一些文章:

http://www.regular-expressions.info/unicode.html - unicode script http://www.regular-expressions.info/unicode.html-Unicode脚本

Basically they suggest using either \\p{Han}+ or [\\x{4e00}-\\x{9fa5}]+.* to detect Chinese character.基本上,他们建议使用\\p{Han}+[\\x{4e00}-\\x{9fa5}]+.*来检测汉字。 Is there a way to detect Chinese punctuation mark as well?有没有办法检测中文标点符号?

Some example (but not all) of Chinese punctuation mark: :?。,《》「」『』-()【】一些(但不是全部)中文标点符号:??。,《》「」『』-()【】

I have noticed that there are question asked on how to detect Chinese character with regex.我注意到有人问如何用正则表达式检测汉字的问题。 These are some question I read on stackoverflow:这些是我在stackoverflow上阅读的一些问题:

Php check if the string has Chinese chars PHP检查字符串是否包含中文字符

detecting chinese characters in php string 在php字符串中检测汉字

And some article outside stackoverflow:在stackoverflow之外还有一些文章:

http://www.regular-expressions.info/unicode.html - unicode script http://www.regular-expressions.info/unicode.html-Unicode脚本

Basically they suggest using either \\p{Han}+ or [\\x{4e00}-\\x{9fa5}]+.* to detect Chinese character.基本上,他们建议使用\\p{Han}+[\\x{4e00}-\\x{9fa5}]+.*来检测汉字。 Is there a way to detect Chinese punctuation mark as well?有没有办法检测中文标点符号?

Some example (but not all) of Chinese punctuation mark: :?。,《》「」『』-()【】一些(但不是全部)中文标点符号:??。,《》「」『』-()【】

I have noticed that there are question asked on how to detect Chinese character with regex.我注意到有人问如何用正则表达式检测汉字的问题。 These are some question I read on stackoverflow:这些是我在stackoverflow上阅读的一些问题:

Php check if the string has Chinese chars PHP检查字符串是否包含中文字符

detecting chinese characters in php string 在php字符串中检测汉字

And some article outside stackoverflow:在stackoverflow之外还有一些文章:

http://www.regular-expressions.info/unicode.html - unicode script http://www.regular-expressions.info/unicode.html-Unicode脚本

Basically they suggest using either \\p{Han}+ or [\\x{4e00}-\\x{9fa5}]+.* to detect Chinese character.基本上,他们建议使用\\p{Han}+[\\x{4e00}-\\x{9fa5}]+.*来检测汉字。 Is there a way to detect Chinese punctuation mark as well?有没有办法检测中文标点符号?

Some example (but not all) of Chinese punctuation mark: :?。,《》「」『』-()【】一些(但不是全部)中文标点符号:??。,《》「」『』-()【】

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM