OmniDev_

~/tools/regex-tester

Regex Tester

Write and test regular expressions instantly — matches highlighted in real-time. Zero server calls, zero data sent.

// How to use
1. Type your pattern in the regex field
2. Enter test text in the area below
3. Matches highlight in real-time
4. Toggle flags (g, i, m) as needed
5. Capture groups appear in the panel
* \ auto-converts from Korean \ key
100% client-side — no data leaves your browser
//
Enter a pattern above to start matching
test-string
match-output
Matched output will appear here.

What is a Regular Expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. They are used to match, search, replace, and validate strings in text. Regex is supported natively in JavaScript, Python, Java, Go, and virtually every programming language. Mastering regex dramatically speeds up string processing tasks.

Common Patterns

Rather than memorizing the full regex syntax upfront, most real-world tasks can be solved by combining a small set of recurring building blocks. The patterns below cover the vast majority of day-to-day use cases — from extracting numbers and words to matching boundaries and whitespace. Once these become second nature, you can compose them to handle increasingly complex patterns.

\d+One or more digits (0–9)
\w+One or more word characters (a-z, A-Z, 0-9, _)
\s+One or more whitespace characters
^HelloString that starts with 'Hello'
world$String that ends with 'world'
[a-zA-Z]+One or more letters
(\d{3})-\d{4}Phone pattern with capture group
\b\w+@\w+\.\w+\bSimple email-like pattern

Flags

A regex pattern on its own only matches exactly what it describes. Flags change how the entire expression behaves — whether matching is case-sensitive, whether it finds all occurrences or just the first, and how line boundaries are interpreted. Using the wrong flag (or forgetting the g flag when you expect multiple results) is one of the most common sources of subtle regex bugs.

/gglobal

Find all matches, not just the first

/iinsensitive

Case-insensitive matching

/mmultiline

^ and $ match line boundaries

/sdotAll

. matches newline characters too

Quantifiers

Quantifiers control how many times the preceding token must appear for a match to succeed. The distinction between greedy and lazy matching is especially important: greedy quantifiers consume as much input as possible, which can cause a pattern to match far more than you intend — a classic pitfall when parsing HTML or extracting content between delimiters. Adding ? after any quantifier switches it to lazy mode, matching as little as possible instead.

*0 or more of the preceding token (greedy)
+1 or more of the preceding token (greedy)
?0 or 1 — makes preceding token optional
{n}Exactly n repetitions
{n,}n or more repetitions
{n,m}Between n and m repetitions
*?0 or more, lazy (match as few as possible)
+?1 or more, lazy (match as few as possible)

Groups & Anchors

Groups and anchors are what elevate regex from simple pattern matching to a structured data extraction tool. Capturing groups let you isolate specific parts of a match — pulling just the domain from an email address, or the version number from a release string — while anchors constrain where in the input a match is allowed to occur. Lookaheads and lookbehinds take this further, letting you write conditions like "followed by" or "preceded by" without those surrounding characters becoming part of the match result.

// Groups

(abc)

Capturing group — stores the match

(?:abc)

Non-capturing group — groups without storing

(?=abc)

Positive lookahead — followed by

(?!abc)

Negative lookahead — not followed by

(?<=abc)

Positive lookbehind — preceded by

(?<!abc)

Negative lookbehind — not preceded by

// Anchors & Special

^

Start of string (or line with /m)

$

End of string (or line with /m)

\b

Word boundary

\B

Non-word boundary

.

Any character except newline

[^abc]

Any character NOT in the set

a|b

Alternation — match a OR b

Real-World Regex Examples

The fastest way to internalize regex is through practical examples that map to problems you've already encountered. The patterns below cover recurring validation and extraction tasks in web development, scripting, and data processing — email validation, IP addresses, URL parsing, date formats, and more. Each one can be copied directly into the tester above and modified to fit your specific requirements.

Email (basic)

[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

IPv4 address

\b(?:\d{1,3}\.){3}\d{1,3}\b

Hex color

#[0-9a-fA-F]{3,6}\b

URL (https)

https?:\/\/[\w.-]+(?:\/[\w./?#&=-]*)?

ISO date

\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])

Semver version

\d+\.\d+\.\d+(?:-[\w.]+)?

Korean phone no.

0\d{1,2}-\d{3,4}-\d{4}

JWT token

[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+