Trexmi
Developer Ready

Regex Tester PRO

Test regular expressions with detailed matches, named groups, offsets, line and column positions, execution timing, and highlighted previews.

Raw or delimited regex patterns Global and first-match modes Named and numbered capture groups Unicode-aware character offsets
INPUT Sample text to diagnose *
0 chars0 words0 lines
Paste realistic multiline text to debug matches, named groups, offsets, line numbers, and columns. Example: Order API-2048 accepted Order WEB-7315 pending ERROR 503: upstream unavailable

Tool settings

Quick presetsNo regex knowledge required

Choose what you want to find or split. Trexmi fills the pattern and flags automatically; advanced users can edit the regex afterwards.

Enter a raw pattern or a delimited expression, then inspect groups and exact match positions.
Supported flags: g, i, m, s, x, u. The g flag tests all matches.
Ctrl / ⌘ + Enter
Regex Analysis Detailed match data, named and numbered groups, character and byte offsets, line and column positions, timing, and optional highlighted preview.
About the tool

What Regex Tester PRO does

Regex Tester PRO applies a PCRE regular expression to realistic sample text and returns more than a simple match verdict. Each result includes its value, byte offset, Unicode character offset, line, column, length, numbered groups, and named groups.

Enter a raw pattern such as \d+ or a delimited expression such as /(?<user>[A-Z0-9._%+-]+)@(?<host>[A-Z0-9.-]+\.[A-Z]{2,})/giu. The workspace supports global, case-insensitive, multiline, dot-all, extended, and Unicode modes through the flags g, i, m, s, x, and u.

The original source remains visible beside the analysis. That makes optional groups, multiline positions, broad matches, and missed edge cases easier to inspect before the pattern reaches application code.

Regex Tester PRO match analysis with capture groups offsets and highlighted preview
Inspect complete matches, capture groups, positions, timing, and the highlighted source.

How to use

  1. Paste realistic text. Use complete sample data that contains both matching and nonmatching values.
  2. Enter the regex. Use a raw expression or a delimited pattern with flags.
  3. Choose the mode. Return every match or stop after the first result.
  4. Set the limit. Restrict the number of matches returned when testing large input.
  5. Inspect the analysis. Review values, named groups, numbered groups, offsets, line and column positions, and execution time.
  6. Verify in the target environment. Regex syntax and edge-case behavior can differ between PCRE, JavaScript, Python, Java, .NET, and other engines.
Built for the task

Why use Regex Tester PRO?

Focused controls, predictable output, and a workflow designed around this exact transformation.

01

Detailed match inspection

See complete values, positions, lengths, numbered groups, and named groups for every returned match.

02

Flexible pattern input

Use raw patterns or familiar delimited expressions with supported flags.

03

Unicode-aware positions

Character offsets and lengths remain useful for Ukrainian, accented text, emoji, and other UTF-8 content.

04

Execution statistics

Review execution time, pattern length, input length, total matches, and truncation status.

Useful answers

Questions about Regex Tester PRO

Practical details about input, output, privacy, limits, and the best way to use this tool.

01 What is Regex Tester PRO?

Regex Tester PRO is an online regular expression tester that applies a pattern to sample text and returns detailed matches, groups, offsets, line and column positions, timing, and an optional highlighted preview.

02 Can I paste a regex with slashes and flags?

Yes. You can use a raw pattern or a delimited expression such as /hello\s+(world)/gi. Supported flags are g, i, m, s, x, and u.

03 Does the regex tester support named capture groups?

Yes. Named groups are returned separately from numbered groups, including their value, match status, byte offset, character offset, line, column, and length.

04 What does the g flag do?

The g flag enables global matching and returns all matches up to the selected maximum. Without global mode, the tester returns only the first match.

05 Are offsets Unicode-aware?

The result contains both raw byte offsets and Unicode character offsets. This distinction is important because one visible UTF-8 character may use several bytes.

06 Why are line and column numbers useful?

They help locate matches inside logs, configuration files, source code, imported records, and other multiline input without manually counting characters.

07 Why can the same regex behave differently elsewhere?

Regex engines differ. Trexmi uses the server PCRE engine, while browsers normally use JavaScript RegExp. Always verify important patterns in the actual destination environment.

08 How do I test optional capture groups?

Enable the option to include unmatched capture groups. Optional groups that did not participate will appear with a null value and matched set to false.

09 Can a regex freeze or run for too long?

Complex nested quantifiers and ambiguous alternations can cause expensive backtracking. Test representative input, keep patterns focused, and avoid using untrusted patterns in production systems.

10 Is my input modified?

No. The source remains separate. The highlighted preview adds visible markers only to the generated result.

Learn Regex

Read the complete Regex Guide

Understand regex syntax, character classes, groups, quantifiers, flags, practical examples, and common mistakes.

  • Regex syntax and patterns
  • Groups, flags, and quantifiers
  • Debugging and best practices
Read guide Practical explanations and examples

Examples

Inspect named order groups

Named groups and exact source coordinates are returned together.

Input
Text: Order API-2048 accepted
Pattern: \b(?[A-Z]{2,5})-(?\d{3,8})\b
Flags: gu
Output
Match: API-2048
prefix: API
number: 2048
Line: 1
Column: 7

Test multiline error records

Multiline mode lets line anchors evaluate every log record.

Input
Text:
INFO 200: ready
ERROR 503: upstream unavailable
Pattern: ^ERROR\s+(?\d{3}):\s+(?.+)$
Flags: gmu
Output
Match: ERROR 503: upstream unavailable
code: 503
message: upstream unavailable
Line: 2

Include an unmatched optional group

Optional groups can remain visible even when they did not participate.

Input
Text: WEB-7315
Pattern: (?[A-Z]+)-(?\d+)(?:-(?[A-Z]+))?
Include unmatched groups: yes
Output
prefix: WEB
number: 7315
suffix: null
matched: false

How Regex Tester PRO works online

Regex Tester PRO compiles your expression with the selected PCRE flags and executes it against the supplied UTF-8 text. The response includes the compiled pattern, match mode, execution duration, pattern length, input length, total matches found, returned matches, and whether the maximum-match limit truncated the result.

Each full match records both byte and character measurements. Byte positions are useful when integrating with lower-level systems, while character positions are easier to interpret in human-readable Unicode text.

Regex Tester PRO supported flags

Global flag g

Return every match up to the selected maximum. Global matching is also enabled when Match mode is set to All matches.

Case-insensitive flag i

Ignore letter case where supported by the pattern and Unicode mode.

Multiline flag m

Make the beginning and end anchors operate per line instead of only at the beginning and end of the entire input.

Dot-all flag s

Allow the dot token to match newline characters.

Extended flag x

Permit readable whitespace and comments in the pattern. Literal spaces may need escaping.

Unicode flag u

Treat the pattern and input as UTF-8, enabling safer matching of international text.

Regex Tester PRO capture groups and positions

Numbered groups are indexed from 1. Named groups use the identifiers declared in patterns such as (?<year>\d{4}). For every participating group, the result reports value, matched state, byte offset, character offset, line, column, byte length, and character length.

Optional groups can be omitted from the result or included with a null value. Including unmatched groups is useful while debugging alternations and optional sections.

Regex Tester PRO practical examples

Email components

(?<user>[A-Z0-9._%+-]+)@(?<host>[A-Z0-9.-]+\.[A-Z]{2,})

Use flags giu to find every address while preserving separate user and host groups.

ISO dates

\b(?<year>\d{4})-(?<month>0[1-9]|1[0-2])-(?<day>0[1-9]|[12]\d|3[01])\b

This checks the basic numeric shape but does not prove that every date exists on the calendar.

Repeated whitespace

\s{2,}

Useful for locating duplicated spaces, tabs, and line breaks before cleanup.

URLs

https?://[^\s<>"']+

Useful for extraction tests, but production URL validation usually requires a parser rather than one universal regex.

Order identifiers

\b(?<prefix>[A-Z]{2,5})-(?<number>\d{3,10})\b

Named groups make structured identifiers easier to inspect.

Common Regex Tester PRO errors

Unclosed groups or character classes

Expressions such as (abc or [0-9 cannot compile. Regex Tester PRO returns the underlying compilation message instead of a generic invalid-input response.

Unsupported flags

Only g, i, m, s, x, and u are accepted in this workspace. JavaScript-only sticky matching and engine-specific modifiers should be tested in their native environment.

Unexpected empty matches

Patterns containing optional or zero-length alternatives can match positions without consuming text. Review both value and length when diagnosing these results.

Overly broad patterns

Greedy tokens such as .* may capture much more than expected. Use boundaries, character classes, reluctant quantifiers, and realistic negative test cases.

Regex Tester PRO performance and safety

Nested quantifiers, ambiguous alternations, and repeated backtracking can make some patterns expensive. Limit input size, cap returned matches, avoid running untrusted patterns against sensitive production data, and prefer simpler expressions when a parser is available.

The execution time shown by Regex Tester PRO is useful for comparison, but a fast test on one short sample does not guarantee safe performance on every possible input.

Create common patterns with Regex Builder, transform matches with Regex Replace, or collect matching values with Regex Extractor.

Authoritative regex references

Review the PHP PCRE documentation for the server-side engine and the MDN regular expressions guide when targeting browser JavaScript.