Free2Box

Regex テスター

正規表現のテストとデバッグ

パターンフラグ: 1マッチ結果フラグ1マッチ結果0
パターン
正規表現パターンを入力
//g
マッチ結果
パターンとテスト文字列を入力するとマッチ結果が表示されます
パターンとテスト文字列を入力するとマッチ結果が表示されます

次に進む

関連する次のアクションでワークフローを続けます。

パターン

まだ結果はありません

フラグ

g

テスト文字列

まだ結果はありません

マッチ結果

0

Privacy & Trust

パターン

正規表現パターンを入力

テスト文字列

テストするテキストを入力...

よく使うパターン

Email / URL / IPv4

よく使うパターン

コピー

正規表現パターンを入力

例:[a-z]+@[a-z]+\.com

使い方

1

テキストを貼り付けまたは入力

テキスト、コード、またはデータを入力エリアに入力します。

2

オプションを選択

適用する変換やフォーマットを選択します。

3

結果をコピー

ワンクリックで出力をクリップボードにコピーします。

このツールを使う理由

完全無料

Core tools are free. AI and cloud tools may have daily usage limits.

インストール不要

すべてブラウザで実行されます。ソフトウェアのダウンロードやインストールは不要です。

プライベート&安全

Local tools keep input on your device. Tools that transmit data are clearly labelled.

モバイル対応

完全レスポンシブ対応 — スマートフォン、タブレット、デスクトップで利用できます。

Regular Expressions: Pattern Matching Mastery

Key Takeaways

  • Regular expressions provide powerful pattern matching for text validation, extraction, search, and transformation.
  • Understanding regex quantifiers, character classes, groups, and lookaheads is essential for writing efficient patterns.
  • All regex testing runs in your browser — your test data is never sent to any server.

Regular expressions (regex) are one of the most powerful tools in a developer's toolkit, enabling complex text pattern matching in a single expression. From validating email addresses and parsing log files to extracting data from unstructured text, regex is used across virtually every programming language and text processing tool. Mastering regex dramatically increases productivity in text-heavy development tasks.

30+

Languages with native regex support

Key Concepts

1

Character Classes and Quantifiers

Character classes ([a-z], \d, \w, \s) match categories of characters. Quantifiers (*, +, ?, {n,m}) control how many times a pattern repeats. Combining them creates powerful matchers.

2

Capture Groups and Backreferences

Parentheses create capture groups that extract matched substrings. Named groups (?<name>...) improve readability. Backreferences (\1 or \k<name>) match the same text again.

3

Lookaheads and Lookbehinds

Lookahead (?=...) and lookbehind (?<=...) assert that text exists before or after the match without including it in the result. Negative versions (?!...) and (?<!...) assert absence.

4

Greedy vs. Lazy Matching

By default, quantifiers are greedy (match as much as possible). Adding ? makes them lazy (match as little as possible). This distinction is critical for avoiding over-matching in complex patterns.

Pro Tips

Start with a simple pattern and incrementally add complexity — debugging a complex regex all at once is extremely difficult.

Use non-capturing groups (?:...) when you need grouping for alternation or quantifiers but do not need to capture the match.

Beware of catastrophic backtracking — nested quantifiers like (a+)+ on non-matching input can cause exponential processing time.

Use the 'u' flag in JavaScript regex for proper Unicode handling, especially when working with international text.

All regular expression testing is performed entirely in your browser using JavaScript's built-in RegExp engine. Your test strings and patterns are never transmitted to any server.

よくある質問