DevToolBox

Regex Tester

正規表現をリアルタイムでテストし、マッチ結果をハイライト表示します。

広告スペース
//

How to Use the Regex Tester

This free online regex tester lets you write and test regular expressions in real time with instant match highlighting. Enter your pattern in the regex field, set your desired flags, and type or paste your test string. Matches are highlighted immediately as you type, and a detailed match table shows each match along with its position and captured groups. All processing runs entirely in your browser using the native JavaScript RegExp engine.

Understanding Regex Flags

JavaScript supports several regex flags that modify matching behavior. g (global) finds all matches rather than stopping at the first one. i (case-insensitive) ignores case when matching letters. m (multiline) makes ^ and $ match the start and end of each line rather than the entire string. s (dotAll) makes the dot character match newline characters as well. u(unicode) enables full Unicode matching. You can combine multiple flags, for example "gi" for global case-insensitive matching.

Common Regex Patterns

Some commonly used patterns include \d+ for matching numbers, [a-zA-Z]+ for matching words, \b\w+@\w+\.\w+\b for basic email matching, and https?:\/\/\S+ for matching URLs. Captured groups using parentheses are shown in the match details table, making it easy to extract specific parts of your matches.

Tips for Writing Regex

Start simple and build complexity gradually. Use the real-time highlighting to verify each part of your pattern works before adding more. Remember to escape special characters like dots, brackets, and backslashes with a backslash when you want to match them literally. Captured groups with parentheses allow you to extract substrings from matches, which is useful when parsing structured text like log files or CSV data.

正規表現テスターの使い方

パターン欄に正規表現を入力し、テスト文字列を貼り付けるとリアルタイムでマッチ箇所がハイライト表示されます。 フラグ(g, i, mなど)を組み合わせて検索動作を変更でき、マッチ詳細テーブルで各マッチの位置やキャプチャグループも確認できます。 全ての処理はブラウザ内で完結し、データが外部に送信されることはありません。

関連ツール

広告スペース

開発をもっと効率的に

PR

広告スペース