Regex-Tester und Debugger
Testen Sie reguläre Ausdrücke live und sehen Sie Treffer, Positionen und Gruppen. Die gesamte Verarbeitung erfolgt in Ihrem Browser; Ihre Eingaben werden nie an den Server gesendet.
Regular expressions are easy to write and hard to trust. The fastest way to find out whether a pattern does what you think is to run it against real text and look at every match. This tester does that live, showing each match with its position and every capture group — including named groups — so you can see exactly what your pattern grabbed.
So funktioniert es
- Type your pattern without the surrounding slashes. Write \d, not /\d/.
- Set the flags: g for all matches, i for case-insensitive, m to make ^ and $ match line boundaries, s to let . match newlines.
- Paste realistic sample text — including the edge cases you are worried about, not just the happy path.
- Read the match list. Every group is numbered, so you can confirm the parentheses you added capture what you intended.
Häufige Fragen
- Which regex flavour is this?
- JavaScript, the ECMAScript flavour. It is close to PCRE for everyday patterns, but lookbehind support and some Unicode property escapes differ from Python or PHP.
- Why does my pattern match nothing?
- Most often an unescaped special character. A literal dot must be \., and a literal slash or plus needs escaping in some positions. The error message under the field tells you when the pattern itself is invalid.
- What does the g flag actually change?
- Without g you get only the first match. The tool adds g automatically for listing purposes, but keep it in mind when you copy the pattern into your own code.
- Can a regex hang my browser?
- A catastrophically backtracking pattern such as (a+)+$ against a long non-matching string can. If the page freezes, close the tab — nothing is saved or sent.