About This Tool
What is 正規表現テスター?
A tool for testing regular expressions with real-time matching against test strings. Used for debugging and developing regex patterns for string searching, validation, and text parsing in development workflows.
How to Use
- Enter your regex pattern in the top input field.
- Enter the test string in the area below.
- Matching portions are highlighted in real-time.
- Configure flags (case insensitive, multiline, etc.) to adjust matching behavior.
Key Features
- Real-time regex matching with highlighting
- Case insensitive, multiline, and dotAll flags
- Detailed match text, position, and capture group display
- ECMAScript, RE2, and PCRE2 engine selection
Tips
- For email validation, use standardized regex patterns rather than simple ones.
- Capture groups () allow you to extract specific matched portions.
- Using the ? quantifier performs lazy (non-greedy) matching instead of the default greedy matching.
正規表現テスター
リアルタイムマッチングで正規表現をテストします
Frequently Asked Questions
ECMAScript、RE2、PCRE2エンジンの違いは何ですか?▼
ECMAScriptはJavaScriptの標準正規表現エンジンです。RE2(Go、Googleで使用)は高速で線形時間を保証しますが、後方参照や先読みなどの機能がありません。PCRE2(PHP、Nginxで使用)は最も機能が豊富で、再帰、条件付きパターンなどをサポートします。
'g'(グローバル)フラグは何をしますか?いつ使うべきですか?▼
'g'フラグなしでは、正規表現は最初のマッチで停止します。'g'ありではすべてのマッチを検索します。すべての出現箇所を検索・置換する必要がある場合に'g'を使用してください。注意:JavaScriptでは'g'をtest()と使用するとlastIndexの状態により不整合な結果が生じることがあります。
複数行にまたがるテキストをマッチさせるには?▼
デフォルトでは^と$は文字列全体の先頭/末尾にマッチし、.は改行にマッチしません。'm'(multiline)フラグを有効にすると^と$が行の境界にマッチします。's'(dotAll)フラグを有効にすると.が改行文字にもマッチします。
Related Tools
コーデック (エンコーダー/デコーダー)
Base64, Base64URL, Base32, Hex, ASCII85のエンコード/デコード
URL エンコーダー / デコーダー
URL 文字列をエンコードまたはデコードします
データフォーマット変換ツール
JSON、YAML、TOML、XML、INI、Properties 形式間の変換と検証
ハッシュジェネレーター
テキストから MD5、SHA-1、SHA-256、SHA-512 ハッシュを生成します
JWT エンコーダー / デコーダー
JWT トークンをエンコードまたはデコードします
ケース変換ツール
テキストを camelCase、PascalCase、snake_case などに一括変換します