CR Tools

Regex Tester

Match, replace, split and get a plain-English reading of the pattern.

Without the delimiters: (?<year>\d{4})-(\d{2})-(\d{2}) is compiled as /(?<year>\d{4})-(\d{2})-(\d{2})/. Maximum 1,000 characters.

Any letter can be combined. The full PCRE set is i m s x u U D A; flag values the engine does not need (S, J, n) are dropped.

The text the pattern runs against. Maximum 200,000 characters.

PCRE, exactly as PHP compiles it.

Nothing yet: write a pattern, paste a subject and press the button.

What to watch for.

PCRE backtracking cannot be interrupted from PHP, so a catastrophic pattern is not something you can stop halfway: that is why the subject is capped at 200,000 characters and the pattern at 1,000. Only the first 200 matches are listed.