Basic Grammar

捕获组及反相引用 Grouping and Backreferences

修改器 Modifiers

Atomic Grouping and Possessive Quantifiers

查看器 Lookaround

Continuing from The Previous Match

Conditionals

Comments

Common Usage

  1. 匹配中文 [\u4e00-\u9fa5]

  2. 匹配首尾空白字符 ^\s*|\s*$

  3. 匹配邮件地址 \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

  4. 匹配不含有连续横杠的字符串 (-(?!-)|[a-z0-9])*

TOP