Tools / Regex Tester

Regex Tester

Write a regular expression, paste a test string, and see every match highlighted in real time. Toggle flags, use named capture groups, and pick from common CTF patterns like the picoCTF flag format or hex strings.

Quick patterns

//g

Enter a pattern and test string to see matches highlighted.

Regular expressions in CTF challenges

Regex appears in CTFs in two contexts: challenges that ask you to supply a matching string (like MatchTheRegex), and challenges where you use regex yourself to extract flag patterns from large blobs of output.

When a challenge asks for a string that satisfies a regex, inspect the page source or server response to find the hidden pattern, then construct a matching input. Common requirements include a minimum length, specific character classes, or anchors that force the string to start or end a certain way.

When you need to extract a flag from output (e.g., strings from a binary), picoCTF\{[^}]+\} captures any flag-format string. The quick-pattern buttons above include this and other useful patterns.

Challenges solved with this tool: picoCTF 2023 -- MatchTheRegex.