Regex explainer
Paste a regular expression to see each part explained in plain words: groups, repeats, character classes, lookarounds and flags. Hover to see each part.
How to read a regex
- Paste the regex, as /pattern/flags like in code or just the pattern.
- Read the explanation line by line: each line is one part of the regex, with its inner parts indented.
- Hover or select a line to see that part highlighted in the regex.
Frequently asked questions
JavaScript's regex syntax, including named groups, lookahead and lookbehind, Unicode property escapes and flags. The basics are the same as in Python, PHP or Java.
In JavaScript, \w only covers unaccented Latin letters, digits and the underscore. To match accented letters, use \p{L} with the u flag.
A ? after +, * or a repeat count (for example .+?) makes the regex stop at the shortest match instead of the longest. For example <.+?> takes a single tag, while <.+> runs from the first tag to the last.
A capturing group (…) remembers what it matched so you can use it, such as pulling the year out of a date. A non-capturing group (?:…) only groups parts together and remembers nothing.
It is completely free and needs no sign-up.
Related tools
Regex testerTest a regex: highlighted matches, groups and replaceRegex generatorReady-made regex for email, phone, dates and moreCron expression generatorPick a schedule, get the cron expressionCron expression parserRead a cron expression and see when it runsJWT decoderRead a JWT's header, payload, expiry and check its signatureJWT generatorSign a JWT with a secret or a private keyMarkdown previewType Markdown, preview it live and get the HTMLHTML to MarkdownTurn HTML or copied content into MarkdownUnix timestamp converterTimestamp ⇄ date, with the current epoch time