正規表現(Regex)検証・テストツール
正規表現(Regex)のマッチングをリアルタイム検証します。
概要:正規表現パターンとフラグ(g/i/m)を指定しテキストのマッチング箇所をリアルタイム強調表示します。
Regular Expression Parameters
//g
Expression Flags
Pattern Match Status
0 Matches
Live Highlight Preview
Hello World 1234, order 5678
Regex Quick Cheat-Sheet Reference▼
Character Classes
- . - Any character except newline
- \d - Any digit (0-9)
- \w - Word character (a-z, A-Z, 0-9, _)
- \s - Whitespace character
- [abc] - Any character in brackets
- [^abc] - Any character NOT in brackets
Quantifiers
- * - 0 or more times
- + - 1 or more times
- ? - 0 or 1 time (optional)
- {n} - Exactly n times
- {n,} - n or more times
- {n,m} - Between n and m times
Anchors & Groups
- ^ - Start of string / line
- $ - End of string / line
- \b - Word boundary
- (abc) - Capture group
- (?:abc) - Non-capturing group
- (?<name>abc) - Named capture group
Embed this Tool on Your Website
Copy this code snippet to add the 正規表現(Regex)検証・テストツール to your blog or website for free. It adjusts dynamically to mobile and desktop screens.
Share This Tool
使い方 — 正規表現(Regex)検証・テストツール
1. 正規表現パターンとフラグ(g, i, m)を入力します。
2. テスト対象のテキストを入力します。
3. マッチした箇所とキャプチャグループを確認します。
仕組み — 正規表現(Regex)検証・テストツール
JavaScript標準の RegExp エンジンでパターン評価します。
計算式:Matches = text.matchAll(new RegExp(pattern, flags))
計算例:
メールアドレス検出パターン `[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}` をテストできます。
よくある質問
JavaScript標準のECMAScript正規表現エンジンを使用しており、Web開発をはじめPythonやPHP、Javaなど主要言語と高い互換性を持ちます。
正規表現パターンとテスト文字列を入力すると、マッチした箇所やキャプチャグループがリアルタイムに色分けハイライト表示されます。
g(全域一致・グローバルマッチ)、i(大文字・小文字を無視)、m(複数行モード)、s(ドットが改行にも一致)、u(Unicodeモード)に対応しています。
文字クラス、量指定子、肯定先読みなど一般的な正規表現文法はそのまま活用可能です。
いいえ。すべての正規表現マッチング処理はお使いのブラウザ上でローカル動作し、機密テストデータも安心してお試しいただけます。