VulCode

Regex tester

Write a pattern and see live what it matches in your text.

Category
For developers
Price
free

The tool starts in your browser.

Everything is calculated in your browser. Nothing you type is sent to our server.

How to use it in three steps

The tool as a schematic with this page's example. Each step's number stands where you take it: in the fields, at the result or outside the tool.

Regex tester
What you enter
Pattern (\d{2})-(\d{3}) on the text "Kody: 00-950 Warszawa, 30-001 Kraków, 80-827 Gdańsk"
  1. Enter the pattern and flags.

  2. Paste the text to test.

What you get
00-950 (group 1: 00, group 2: 950) 30-001 (group 1: 30, group 2: 001) 80-827 (group 1: 80, group 2: 827)
  1. See matches and groups live.

Three postcodes and their groups

A pattern is tested on real text, not on an idea of it. The tool highlights the matches in place and lists the groups below. The result is computed by the same function the tool at the top of the page uses, every time the page is shown.

You enter

Pattern
(\d{2})-(\d{3})
Text
Kody: 00-950 Warszawa, 30-001 Kraków, 80-827 Gdańsk
Flags
g

The expression

RegExp
/(\d{2})-(\d{3})/g
What the tool does

The tool always searches with the g flag. With g unticked it shows only the first match.

Matches

1. 00-950
from character 6
2. 30-001
from character 23
3. 80-827
from character 38
What the tool does

Every hit has its place in the text, counted from zero.

Groups

1. 00-950
group 1: 00, group 2: 950
2. 30-001
group 1: 30, group 2: 001
3. 80-827
group 1: 80, group 2: 827
What the tool does

Brackets make groups: the first catches two digits, the second three.

Matches (3)

  • 00-950
  • 30-001
  • 80-827

Questions

Related tools

The tool does one job. If the same thing should happen automatically in your bot, server or system, we build it.

Missing a tool you need?

Tell us what you want to calculate or generate. We will tell you whether a tool is enough or an integration in your system fits better.