PakTools logoPakToolsPakistan's First Free Online Tools

Regex Tester in Pakistan

Test regular expressions live — matches highlighted, capture groups listed, flags explained.

🔒 Runs in your browser. Nothing uploaded.

How to use

  1. 1

    Type your regular expression pattern, without the surrounding slashes.

  2. 2

    Paste the text you want to test it against.

  3. 3

    Toggle the flags (g, i, m, s, u) and watch the matches highlight live.

Formula / How it works

Your pattern is compiled with JavaScript's RegExp and tested against your sample text in real time.

Matches are highlighted in the text, and each match's capture groups are listed separately.

Flags change the behaviour: g finds all matches, i ignores case, m makes ^ and $ match line starts and ends.

If the pattern is invalid, the exact JavaScript error is shown (for example, an unclosed bracket) instead of failing silently.

Frequently asked questions

What is a regular expression?

A pattern for finding text — for example, \d+ finds any run of digits, and ^[A-Za-z]+$ matches a string made only of letters. They are used for validation, searching and replacing text.

What do the flags mean?

g (global) finds every match, not just the first. i makes matching case-insensitive. m makes ^ and $ work per line. s lets . match newlines. u enables full Unicode mode.

Why is my pattern showing an error?

Usually an unclosed bracket, parenthesis or character class — for example [a-z without the closing ]. The error message names the problem; fix it and the matches update live.

What are capture groups?

Parts of a pattern wrapped in (parentheses). Each group captures the text it matched, so you can extract pieces — for example, (\d{4})-(\d{2}) captures the year and month from a date.

Is my test text uploaded anywhere?

No. Testing happens entirely in your browser with JavaScript RegExp. Your pattern and text never leave your device.

Was this Regex Tester helpful?

Last updated: 15 November 2026 | Reviewed by: Marwat