正则表达式笔记

Tags

案例

在线测试工具:在线正则表达式测试
匹配中文:[\u4e00-\u9fa5] 英文字母:[a-zA-Z] 数字:[0-9] 匹配中文,英文字母和数字及下划线:^[\u4e00-\u9fa5_a-zA-Z0-9]+$
1.密码必须6~16位,且必须包含数字和字母
^(?![0-9]+)[0-9A-Za-z]{6,16}$"
notion image
2.删除空行 ^\s*\n
Johnny要使用正则表达式的时候,也是用的 mytexttools.com

语法

单字符匹配

notion image

匹配分组

notion image

匹配边界

notion image

匹配数量

notion image

资料

  • 精通正则表达式

© fishyer 2022 - 2023