正規表現 テスター
ライブ一致ハイライト表示、グループ詳細のキャプチャ、検索と置換を使用して、正規表現をリアルタイムでテストします。すべての JavaScript 正規表現フラグをサポートします。サインアップやインストールは不要で、ブラウザ内で完全に実行されます。
Regex テスターの使用方法
パターンを書く
正規表現をパターンフィールドに直接入力します。このツールは JavaScript の RegExp エンジンを使用するため、ブラウザ コンソールで機能するパターンはすべてここで機能します。入力すると、テスト文字列内で一致する文字列がリアルタイムで強調表示されます。
フラグ
- g — グローバル: 最初だけでなく、すべての一致を検索します。
- 私 — 大文字と小文字を区別しない: 大文字と小文字を同等に一致させます
- メートル — 複数行:
^そして$各行の先頭と末尾を一致させる - s — ドットオール:
.改行文字にも一致します
グループをキャプチャして置換する
パターンの一部を括弧で囲んで、キャプチャ グループを作成します。 [一致の詳細] パネルには、各グループの値が表示されます。 [置換] フィールドで、次を使用します。 $1、 $2、…参照グループへ、 $& 完全一致の場合はテキスト、リテラル置換の場合はプレーン テキストです。
よくある質問
このテスターはどの正規表現フレーバーを使用しますか?
The tester uses JavaScript's built-in RegExp engine. It supports flags g, i, m, and s. Lookbehind, named capture groups, and Unicode escapes work in any modern browser.
置換フィールドでキャプチャ グループを使用するにはどうすればよいですか?
Use $1, $2, … to reference capture groups. $& inserts the full match. For example, replacing (\w+)\s(\w+) with $2 $1 swaps two words.
私のパターンが予想以上に一致するのはなぜですか?
The global (g) and case-insensitive (i) flags are on by default. Toggle them off to restrict matching. Quantifiers like * and + are greedy — add ? after them for non-greedy matching.
Does this tool send my data to a server?
No. Everything runs entirely in your browser. Your regex patterns and test strings are never transmitted to any server.
テスト文字列の長さに制限はありますか?
There is no hard limit. Very long strings with thousands of matches may cause a brief delay, but typical inputs — log lines, code snippets, API responses — are handled without issue.