Regex Explainer — Regular Expressions in Plain English

Paste a regular expression and see what each part does, in order. You also get example strings that should and shouldn’t match, and a box to test your own text.

AI DevRuns in your browser — nothing uploaded

Flags

What it means

Looks like it matches an Indian PAN number.

  1. ^Start of the text
  2. [A-Z]{5}Exactly 5 × an uppercase letter (A–Z)
  3. [0-9]{4}Exactly 4 × a digit (0–9)
  4. [A-Z]An uppercase letter (A–Z)
  5. $End of the text

Test cases

Should match

  • BBYNR7586Z
  • JRRHN6149I
  • UOARE8888G
  • YIKRF5651G
  • ZBQLK9174Y

Should not match

  • BBYNR7586
  • BBYNR7586Z!
  • BYNR7586Z
  • BBYNRx586Z
  • 7BYNR7586Z

How it works

  1. 1

    Parses the pattern

    The regex is broken into its parts — characters, classes, groups, quantifiers, anchors and lookarounds.

  2. 2

    Explains each part

    Every piece is described in plain English, nested the same way as the pattern, so groups and alternatives stay readable.

  3. 3

    Generates test cases

    Random strings are generated from the pattern and checked against it, then mutated to find near-misses that fail.

  4. 4

    Recognises common formats

    If a pattern matches a known format — PAN, GSTIN, email, Indian mobile number, PIN code, IFSC — it says so.

Questions, answered

JavaScript. Most everyday Python, Java and PCRE patterns use the same syntax, so they explain correctly too. Features unique to other flavours (like possessive quantifiers) may not.

Popular uses