正規表現テスター
Build, test and debug JavaScript regular expressions in real time. Live highlighting, capture groups, replace preview. Supports lookbehind, named groups and Unicode.
Test string
Highlighted
Replace result
A real-time regex playground in your browser
Build and debug regular expressions interactively. As you type the pattern, the test string is re-evaluated and matches are highlighted instantly. Capture groups (both numbered and named) show up in a side panel with their values for every match. No round-trip to a server, no signup, nothing tracked.
ネイティブ JavaScript 正規表現
We use the browser's own RegExp engine, which means the patterns you test here
will behave exactly the same in your JavaScript code. Modern features are all
supported: lookbehind (?<=...), named groups
(?<name>...), Unicode property escapes \p{...},
and the s (dotall) flag.
置換モード
Toggle replace mode to preview a regex-based substitution. The replacement supports all the
standard $ tokens: $1, $2 for numbered groups,
$<name> for named groups, $& for the full match,
$` for text before the match, $' for text after, and
$$ for a literal dollar sign.
ReDoS 保護
Catastrophic backtracking — patterns like (a+)+$ on long input — can hang any
regex engine. We have two safety nets:
- Hard timeout: if matching takes longer than 2 seconds, we abort and tell you.
- Match cap: a maximum of 10,000 matches per evaluation. Beyond that we stop and mark "10000+" so the UI stays responsive.
プライバシー
Your patterns and test text never leave the page. The engine is built into your browser. No external library is loaded, no analytics fires when you type, no requests go out.
よくある使用例
- Validate email, URL, phone or postal-code patterns.
- Extract structured data from logs or scraped text.
- Build search-and-replace queries before running them in your editor.
- Debug a regex that "should work but doesn't" — the highlight makes the problem visible immediately.
- Learn regex by experimentation with the cheatsheet at the bottom.
よくある質問
- オンラインで正規表現をテストするには?
- パターンフィールドに正規表現パターンを貼り付け、テキストエリアにテスト文字列を入力します。入力と同時にマッチがリアルタイムでハイライトされ、キャプチャグループがサイドパネルに表示されます。
- この正規表現テスターはすべてのJavaScriptフラグに対応していますか?
- はい、すべてのJavaScript正規表現フラグに対応しています:g(グローバル)、i(大文字小文字無視)、m(マルチライン)、s(dotall)、u(ユニコード)、y(スティッキー)。
- 正規表現やテストデータはどこかに保存されますか?
- いいえ。すべてがブラウザ内でローカルに実行されます。パターンとテストテキストがサーバーに送信されたり、どこかに保存されたりすることは一切ありません。
- 正規表現のマッチをエクスポートできますか?
- はい。すべてのマッチグループとキャプチャグループが結果パネルに表示され、置換モードを使用して正規表現ベースの置換をプレビューできます。
- この正規表現テスターは無料ですか?
- はい、使用制限なし、サインアップ不要、ワークフローを中断する広告なしで完全に無料です。