正则表达式测试器

Regex Tester

实时测试正则表达式,支持匹配分组高亮

Test regular expressions in real-time with match highlighting and groups

正则表达式Regular Expression
测试文本Test String
匹配结果Matches
输入正则和文本查看匹配结果Enter a pattern and text to see matches
💡 支持 JavaScript 正则语法 💡 JavaScript Regex Syntax
支持常用元字符:. \d \w \s ^ $ * + ? [] () | 等。 点击 g 标记全局匹配,i 不区分大小写。 Supports common metacharacters: . \d \w \s ^ $ * + ? [] () | and more. Toggle g for global, i for case-insensitive.

How to Use This Tool 使用说明

  1. Enter your regular expression pattern in the regex input field.
  2. Add flags like g (global), i (case-insensitive), or m (multiline) using the flag toggles.
  3. Type or paste your test string in the text area below.
  4. Matching portions are highlighted in real-time. Captured groups are displayed separately.
  5. Experiment with different patterns to quickly test and debug your regular expressions.

Frequently Asked Questions 常见问题

← Back to all tools← 返回所有工具