re正则表达式13_review of regex symbols

本文快速回顾了正则表达式中各种符号的用法,包括匹配数量、位置、字符类别等,帮助读者掌握正则表达式的使用技巧。

Review of Regex Symbols

This chapter covered a lot of notation, so here’s a quick review of what you learned:

  • The ? matches zero or one of the preceding group.

  • The * matches zero or more of the preceding group.

  • The + matches one or more of the preceding group.

  • The {n} matches exactly n of the preceding group.

  • The {n,} matches n or more of the preceding group.

  • The {,m} matches 0 to m of the preceding group.

  • The {n,m} matches at least n and at most m of the preceding group.

  • {n,m}? or *? or +? performs a nongreedy match of the preceding group.

  • ^spam means the string must begin with spam.

  • spam$ means the string must end with spam.

  • The . matches any character, except newline characters.

  • \d\w, and \s match a digit, word, or space character, respectively.

  • \D\W, and \S match anything except a digit, word, or space character, respectively.

  • [abc] matches any character between the brackets (such as ab, or c).

  • [^abc] matches any character that isn’t between the brackets.

转载于:https://www.cnblogs.com/webRobot/p/5223690.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值