正規表現テスター
JavaScript の正規表現をリアルタイムでテストし、一致部分とグループを強調表示します。
ブラウザ内で実行され、データが端末外に送信されることはありません完全無料・登録不要
仕組み
Your pattern is compiled with the browser’s own RegExp engine, so behaviour (including error messages) matches what your JavaScript code will see. The compiled expression runs only against the text in this page, never anywhere else. Matches are listed with their position, numbered and named capture groups, and highlighted in place.
The five standard flags (g, i, m, s, u) are individual checkboxes, so you can see exactly which flags change the outcome.
主な機能
- Match list with positions and full capture groups
- Named group support ((?<name>…))
- In-place match highlighting in the test text
- Standard flags as explicit checkboxes
- Engine-accurate errors for invalid patterns
- 100% client-side: nothing leaves your browser
使い方
- Enter the pattern (without surrounding slashes).
- Toggle the flags you need.
- Paste test text and press Test pattern.
- Read the matches, groups and highlighted text.
例
Pattern: (\w+)@([\w.-]+)\.[a-z]{2,}
Text: [email protected]
Match: [email protected]
group 1: support
group 2: devcodivo.comよくある質問
- Which regex flavor does this tester use?
- The exact same one your browser uses: JavaScript (ECMAScript) regular expressions. That makes it an honest tester for code that will run in JavaScript: what matches here matches in your app. PCRE, .NET or Rust regex may behave differently (lookbehind, Unicode classes, possessive quantifiers).
- Why is my pattern invalid here but works elsewhere?
- Most often it uses features JavaScript doesn't support, such as possessive quantifiers (a++), K, named character classes like p{letter} without the u flag, or callouts. The error message shows the engine's own explanation of where it gave up.
- What do the numbered groups mean?
- Groups are the parenthesized parts of your pattern, numbered by their opening parenthesis from left to right. Group 1 is the first pair of parentheses. A group shows "(not matched)" when it is optional or part of an alternation that didn't participate in that match.
- Can regexes be dangerous?
- Complex regexes can exhibit catastrophic backtracking, where matching time explodes on certain inputs (this is a real denial-of-service vector on servers). This tool caps results at 5000 matches to stay responsive, but if the tab freezes, your pattern has a backtracking problem worth fixing.
- Is my text sent to a server?
- No. The pattern is compiled and executed entirely in your browser. Nothing you enter is transmitted anywhere, and you can verify this in your browser's network inspector.