Regex simplifier
Rewrite a regular expression as a shorter, functionally equivalent pattern.
Regex simplifier
Paste one regular expression, or a whole list of them, and this tool rewrites each one into a shorter pattern that matches exactly the same text. It is built for cleaning up regex that came from a generator, an old script, or a code review comment that says "this can probably be shorter" — one paste turns a folder of ad-hoc patterns into a tidy, reviewable list.
By default the input is split by line, so every line is treated as its own pattern; switch to splitting by word when your patterns are space-separated instead. Case-sensitive matching and ignore diacritics control how duplicate lines are detected before simplifying, so "Foo" and "foo" — or "cafe" and "café" — can be treated as the same entry or kept apart. Turn on sort results to order the output alphabetically, and set a limit to cap how many simplified patterns come back, which is useful when you pasted more than you meant to review at once.
The simplifier only ever removes what is provably redundant: unnecessary non-capturing groups, quantifiers like {1,1} or {0,1} written out longer than they need to be, character classes with unsorted or overlapping ranges, and alternatives that differ by a single character get folded into one class. Capturing groups, named groups and lookaround are never touched beyond simplifying what is inside them, since removing those would change what a later part of your code can reference. A pattern the tool cannot safely shorten — or cannot parse — is returned exactly as you typed it, and an invalid pattern is left alone rather than guessed at. Export the results as a plain list or as a CSV with the original, the simplified version and the characters saved in each row.
Everything runs locally in your browser — your patterns are never uploaded or logged, so it is safe to paste code straight from a private project. Copy the result, download it as a .txt file, or send the output back into the input to run another pass.