Regex Tester & Match Extractor

Define your own regular expression (regex) to search the input data with, optionally choosing from a list of pre-defined patterns.

Input: TextResult: HTML with a sandboxed preview

Text input

Tool options

Examples

Regex: Astral off

Input

𝌆😆

Expected answer

Empty result
Built in regexes
User defined
Regex
\pS
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
List matches
Regex: Astral on

Input

𝌆😆

Expected answer

𝌆
😆
Built in regexes
User defined
Regex
\pS
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
Off
Unicode support
Off
Astral support
On
Display total
Off
Output format
List matches
Regex: Dot matches all

Input

Hello
World

Expected answer

Hello
World
Built in regexes
User defined
Regex
.+
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
On
Unicode support
Off
Astral support
Off
Display total
Off
Output format
List matches
built in email regex - invalid IP address

Input

yaunwfkb
false_positive@[1.2.3.]
091nvka

Expected answer

Empty result
Built in regexes
Email address
Regex
(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?\.)+[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\])
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
List matches
built in email regex - IP address

Input

yaunwfkb
example@[127.0.0.1]
091nvka

Expected answer

example@[127.0.0.1]
Built in regexes
Email address
Regex
(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?\.)+[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\])
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
List matches
built in email regex - IPv4 from #2318

Input

user@[1.2.3.4]
test@[192.168.0.1]
no-match@[1.2.3.]

Expected answer

user@[1.2.3.4]
test@[192.168.0.1]
Built in regexes
Email address
Regex
(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?\.)+[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9](?:[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9-]*[\u00A0-\uD7FF\uE000-\uFFFFa-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\])
Case insensitive
On
^ and $ match at newlines
On
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
List matches
highlight with escaped named capture group

Input

~'><script>alert('1')</script>

Expected answer

<span class='hl2' title='Offset: 0
Groups:
	1: ~
'>~</span>&#x27;&gt;&lt;script&gt;alert(&#x27;1&#x27;)&lt;/script&gt;
Built in regexes
User defined
Regex
(?<\u0041>~)
Case insensitive
Off
^ and $ match at newlines
Off
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
Highlight matches
highlight with named capture group

Input

ab ab

Expected answer

<span class='hl2' title='Offset: 0
Groups:
	1: a
	2: b
'>ab</span> <span class='hl1' title='Offset: 3
Groups:
	1: a
	2: b
'>ab</span>
Built in regexes
User defined
Regex
(?<x>a)(b)
Case insensitive
Off
^ and $ match at newlines
Off
Dot matches all
Off
Unicode support
Off
Astral support
Off
Display total
Off
Output format
Highlight matches

Supports extended regex syntax including the 'dot matches all' flag, named capture groups, full unicode coverage (including \p{} categories and scripts as well as astral codes) and recursive matching.

Format reference: Regular expression background and specification

Choose the output you need

Highlight matches for inspection, or select a list output to copy matching strings and capture groups. Multiline anchors and dot-matches-all are separate switches.

Pattern engine differences

This tool supports extended JavaScript-style regular expressions through its engine. A pattern may behave differently in PCRE, Python or another runtime. Test it in the target application before deploying it.

Parameters

ParameterDefault valueInput and choices
Built in regexes"User defined"Text
14 Available choices
  • User defined
  • IPv4 address
  • IPv6 address
  • Email address
  • URL
  • Domain
  • Windows file path
  • UNIX file path
  • MAC address
  • UUID
  • Date (yyyy-mm-dd)
  • Date (dd/mm/yyyy)
  • Date (mm/dd/yyyy)
  • Strings
Regex""Text
Case insensitivetrueOn or off
^ and $ match at newlinestrueOn or off
Dot matches allfalseOn or off
Unicode supportfalseOn or off
Astral supportfalseOn or off
Display totalfalseOn or off
Output formatHighlight matchesHighlight matches, List matches, List capture groups, List matches with capture groups

Related tools

Browse utils tools