Regular expression tester
Type a regular expression and a text and see what matches with the real Python or Java engine, not the browser’s: the matches marked, the groups, what each function returns (match, search, fullmatch or matches(), find()) and the code you would write, with Java’s double backslashes. It runs in your browser, on your phone too.
How to use it
- Choose Python or Java. When you switch, the pattern is translated:
(?P<day>…)becomes(?<day>…)and\g<day>becomes${day}. - Type the pattern and the text, or pick an example: IP addresses in a log, dates to ISO with named groups, number plates, emails, marks line by line, greedy versus lazy or a
split. - Tick the flags you need (
re.IGNORECASE,re.MULTILINE… orPattern.CASE_INSENSITIVE,Pattern.MULTILINE…) and, if you like, a replacement. - Press Step to watch
re.finditer()orfind()search, match by match, with its groups. Tap a function to see its code.
How it works
Python runs on Pyodide (CPython 3.14 compiled to WebAssembly) with its re module, and updates as you type. Java is really compiled with javac + TeaVM, like the Java playground, and uses OpenJDK 21’s java.util.regex: each run takes about 3 seconds, which is what compiling costs.
TeaVM’s own regex is not used because it gives wrong results with some patterns: \d{1,3}(?:\.\d{1,3}){3} did not find the IP 192.168.1.20. OpenJDK’s gave the same as Java on 1,500 test cases, with the same error messages.
The rules it follows
- Python and Java do not write patterns the same way: named groups are
(?P<n>…)in Python and(?<n>…)in Java, and in the replacement\g<n>and\1versus${n}and$1. matchandlookingAt()only look at the start;fullmatchandmatches(), the whole text;searchandfind(), anywhere.- If a pattern takes too long (catastrophic backtracking, like
(a+)+bon a long text that does not match), it is stopped and explained. \p{IsLatin},\p{InGreek}and\N{…}are not available in Java: they give a clear error, never a wrong result.
For the exam
FP1 and FP2 exams ask for patterns that validate data (ID numbers, number plates, dates, emails) and what each function returns. The challenge below gives you a list of strings that must fit and others that must not, and checks it with the real engine of the language you choose.

IC2 practical mock exam — flowcharts, fork and threads in C (and the screenshots you can’t leave out)