javascript - 求个 匹配 微博@ 正则表达式格式?

WBOY
Release: 2016-06-06 20:31:56
Original
1069 people have browsed it

匹配微博 正则表达式格式?

回复内容:

匹配微博 正则表达式格式?

这个支持最长20个字的名字,只要不是空格的都当有效,取出来之后再验证是否有效用户名
/@[^\s]{1,20}/

如果不限长度
/@[^\s]+/

如果用户名只可能是英文下划线和数字
/@[a-z0-9_]+/i

如果还有可能是中文
/@[a-z0-9_\u4E00-\u9FA5]+/i/

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template