Regex Tester

正则表达式测试器

Test JavaScript regular expressions with live highlighting.

用 JavaScript 正则表达式实时测试并高亮匹配。

Video tutorial

视频教程

Quick regex reference

正则速查

  • \d — digit (0-9)—— 数字 (0-9)
  • \w — word character (letter, digit, underscore)—— 单词字符(字母、数字、下划线)
  • \s — whitespace—— 空白
  • ^ / $ — start / end of line—— 行首 / 行尾
  • * / + / ? — 0+, 1+, 0 or 1—— 0+、1+、0 或 1
  • (...) — capture group—— 捕获组
  • [abc] — any of a, b, or c—— a、b 或 c 任一
  • {n,m} — between n and m repetitions—— n 到 m 次重复