Skip to content
ZeroKit

Regular expression

A regular expression is a pattern language for matching text, built from literals, character classes, quantifiers, groups and anchors.

It is the right tool for 'does this string look like X' and the wrong tool for parsing nested structures such as HTML or JSON, where a real parser is both safer and faster.

Flavours differ: JavaScript, PCRE and Python's re module disagree on lookbehind, named groups and Unicode classes, which is why a pattern copied between languages can silently stop matching.

Catastrophic backtracking is the classic production incident: a pattern like (a+)+b against a long run of a's can take exponential time. Prefer explicit repetition and test with adversarial input.

Apply it: Regex Tester

Test regular expressions against your own text with live highlighted matches, numbered capture groups, flag toggles and a replace preview.

Open the free Regex Tester →
  • JSON — JSON (JavaScript Object Notation) is a text format for structured data built from objects,…