TEXT WORKSPACE
Regex Tester
Inspect bounded PCRE2 matches and byte positions.
Input is processed on this site only when you run the tool. The application does not save inputs or results.
input.txt
changed.txt
Result result.json
A little clarity goes here.
Run the tool to see your result.
Result preview
UTF-8 text, at most 32768 bytes per input. Tab leaves the editor. Plain text disables syntax colors. Browser textareas may normalize line endings to LF.
{"match":{"inputMode":"pair","options":{"flags":{"type":"enum","values":["u","iu","mu","imu","su","isu"],"default":"u"}},"inputLabels":{"input":"Pattern without delimiters","input2":"Subject"},"inputLimits":{"input":2048,"input2":32768}}}{"match":{"input":"(?<word>\\p{L}+)","input2":"Hello \u6771\u4eac 42","options":{"flags":"u"}}}A QUICK WALKTHROUGH
A familiar workflow,
with room to focus.
Enter a raw PCRE2 pattern without delimiters, and a UTF-8 subject.
Choose fixed Unicode flag combinations and run Match.
Inspect highlighted matches; select a numbered or named capture to locate it. Byte offsets are listed in the capture table.
When to use Regex Tester
Try a bounded PCRE2 pattern against a small UTF-8 subject and inspect captures when building a server-side text matcher.
Read the result
Offsets are byte positions, not visible-character positions. Captures show null and -1 for unmatched groups; exhausting a work limit means the attempted match was not completed.
SEE IT IN PRACTICE
Worked examples
Sample input. A result you can inspect.
Match example
Pattern without delimiters
(?<word>\p{L}+)Subject
Hello 東京 42
- PCRE2 flags
- Unicode
Expected result
{"count":2,"matches":[{"groups":[{"group":0,"text":"Hello","byteOffset":0},{"group":"word","text":"Hello","byteOffset":0},{"group":1,"text":"Hello","byteOffset":0}]},{"groups":[{"group":0,"text":"東京","byteOffset":6},{"group":"word","text":"東京","byteOffset":6},{"group":1,"text":"東京","byteOffset":6}]}]}{"kind":"regex","title":"2 matches","subject":"Hello \u6771\u4eac 42","matches":[{"start":0,"end":5,"match":1},{"start":6,"end":8,"match":2}],"ranges":[{"start":0,"end":5,"match":1},{"start":0,"end":5,"match":1},{"start":0,"end":5,"match":1},{"start":6,"end":8,"match":2},{"start":6,"end":8,"match":2},{"start":6,"end":8,"match":2}],"columns":["Match","Group","Captured text","Byte offset"],"rows":[["1","0","Hello","0"],["1","word","Hello","0"],["1","1","Hello","0"],["2","0","\u6771\u4eac","6"],["2","word","\u6771\u4eac","6"],["2","1","\u6771\u4eac","6"]],"total":6,"note":"Highlights are complete matches. Capture groups below identify the matched portions; group 0 is the whole match. Offsets count UTF-8 bytes.","truncated":false,"schema":1}Formats, limits and common errors
Invalid patterns and exhausted limits return fixed errors, never compiler diagnostics or partial matches.
- Pattern at most 2,048 bytes; subject at most 32,768 bytes. This is PCRE2, not browser JavaScript regex syntax.
- Per-match limits: 10,000 match steps, depth 100, heap 1,024 KiB; JIT is disabled for these matches. Lower server limits still apply.
- At most 200 matches, 64 numbered captures and 500,000 aggregate capture bytes. A cooperative 500ms check rejects slow calls after they return; it cannot interrupt a native call.
- Empty matches advance one Unicode code point, with no alternative nonempty retry at that position. Unmatched groups use null and offset -1. Backslash-C byte matching is unsupported. No replacement or execution.
- Input: 32,768 UTF-8 bytes per text field. Output: at most 524,288 UTF-8 bytes; serialized responses have a separate 1 MiB ceiling. Size/work failures return no partial result.