Regex Tester

Test regular expressions live with Indian format presets.

Matches
1
#1
9876543210

A match only checks the format. It cannot prove that a PAN, GSTIN, IFSC or pincode exists.

About this tool

Regular expressions describe text patterns, and getting one right usually takes several tries. This tester lets you type a pattern and some sample text and see the matches straight away. It uses your browser's JavaScript regular expression engine, so what works here will work in JavaScript code. Enter flags such as g for all matches, i to ignore case and m so that ^ and $ match at each line. The g flag is added automatically if you leave it out so that all matches are listed. If the pattern is not valid, a clear error message appears instead of the page failing. Preset buttons load common Indian patterns such as mobile numbers, PAN, GST numbers, IFSC codes and pincodes. A pattern match only checks the format of a value; it cannot prove that a PAN, GST number or account really exists.

How to use it

  1. Type your regular expression in the pattern box.
  2. Set the flags, for example gm or gi.
  3. Paste the text you want to test against.
  4. Read the number of matches and the list of matches.
  5. Adjust the pattern until it matches exactly what you want.

How it works

The tool builds a RegExp from your pattern and flags and lists every match from the text. Common building blocks: \d is a digit, \w a word character, [A-Z] a capital letter, {n} exactly n repeats, + one or more, * zero or more, ^ the start and $ the end.

Example: The pattern ^[6-9]\d{9}$ with flags gm against the two lines 9876543210 and ABCDE1234F matches only the first line, because it is a ten-digit number starting with 6 to 9.

Common uses

  • Building and checking a validation pattern for a form field.
  • Finding all email-like or number-like strings in a block of text.
  • Learning regular expressions by testing small examples.

Frequently asked questions

Which regex flavour does it use?
JavaScript's. Features in other flavours, such as some lookbehind variations or named syntax, may behave differently in other languages.
What do the flags mean?
g finds all matches, i ignores letter case, m makes ^ and $ work on each line and s lets the dot match line breaks.
Why does my pattern show an error?
The pattern is not valid, for example an unclosed bracket or a bad escape. The error message from the browser explains the problem.
Can a pattern prove a PAN or GST number is real?
No. A pattern only checks the format. It cannot confirm that the number was issued.
Is my text sent anywhere?
No. Matching runs in your browser.

Last reviewed 2026-11-01. Browse all tools