Azlaan Electric AC Solar Center — Solar, CCTV, AC & electrical work, Faisalabad Call: 0300-8987448

Regex Pattern Tester

Test a regular expression against sample text. Matches are highlighted live, you get the match count, every capture group is listed, and you can try find-and-replace with the same pattern.

/ /
0 matches

Highlighted matches

Capture groups

Groups will appear here after a successful match.

Find-and-replace test

Uses the same pattern and flags. In the replacement you can use group references such as $1, $2 and named groups such as $<name>.


                

Common pattern presets

Click a preset to load its pattern, flags and a sample test string.

How to use

  1. Type your regular expression in the pattern box and pick one or more flags.
  2. Paste your text in the test string area. Matches are highlighted as you type.
  3. Check the match count badge and expand the groups list to inspect each capture group.
  4. Use the replace section to try a replacement string with group references.
  5. Copy the pattern or the result with the Copy buttons.

Flag reference

  • g (global): finds all matches instead of stopping at the first one.
  • i (case-insensitive): matching ignores upper and lower case.
  • m (multi-line): ^ and $ match the start and end of each line.
  • s (dotAll): the dot also matches newline characters.
  • u (unicode): full unicode support, needed for some special escapes.
  • y (sticky): matching starts exactly where the last search left off.

Frequently Asked Questions (FAQ)

What does the Regex Pattern Tester do?

It tests a regular expression against your sample text in real time. Matching parts of the text are highlighted, you get the total match count, and every capture group is shown.

Which regex flags are supported?

Six flags are supported: g for global matching, i for case-insensitive matching, m for multi-line mode, s to let the dot match line breaks, u for unicode mode and y for sticky matching.

Which ready-made patterns are included?

Six presets are included: email address, URL, IPv4 address, Pakistan mobile number starting with 03, date, and password strength.

Can I test find and replace?

Yes. The replace section lets you enter a replacement string with group references like dollar-one and instantly see the result.

Is my text sent anywhere?

No. Everything runs inside your browser and your text never leaves your device.