Tool to simplify a regex. Regexp simplifier (or regular expression) shortens the string of characters to search for patterns in a text.

Regular Expression Simplifier - dCode

Tag(s) : Data Processing

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!

A suggestion ? a feedback ? a bug ? an idea ? *Write to dCode*!

Regular expression simplification is a method for removing unnecessary elements from certain regular expressions in order to simplify, minimize or make it more readable by analyzing the patterns that make up the regex string.

The regular expressions simplifier (beta version) replaces useless elements in a regular expression.

__Example:__ `x{0,}` is equivalent to `x*` through simplification

__Example:__ `[aaabbb]` is equivalent to `[ab]`

__Example:__ `(ab|ac)` can also be written `a[bc]`

Some regular expressions can not be simplified. In this case, the program will return the same string.

The program/optimizer is in beta test, and does not work all the time! Moreover, some parentheses, potentially useful for capturing can be deleted and escape characters can be ignored.

There are shorthand character classes and metacharacters:

abbreviation | equivalent |
---|---|

\d | [0-9] |

\w | [A-Za-z0-9_] |

\s | [ \t\r\n\f] |

\D | [^\d] |

\W | [^\w] |

\S | [^\s] |

The letter `d` for `digit` (digit), `w` for `word` (letter / alphanumeric character) and `s` for `space` (spacing), uppercase letters represent the negation of the set

__Example:__ `D` for a character that is not a number, etc.

dCode retains ownership of the "Regular Expression Simplifier" source code. Except explicit open source licence (indicated Creative Commons / free), the "Regular Expression Simplifier" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "Regular Expression Simplifier" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Regular Expression Simplifier" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!

Reminder : dCode is free to use.

The copy-paste of the page "Regular Expression Simplifier" or any of its results, is allowed as long as you cite dCode!

Cite as source (bibliography):

*Regular Expression Simplifier* on dCode.fr [online website], retrieved on 2022-09-30,

regular,expression,pattern,string,character,search,metacharacter,regex,regexp,simplify,simplification,minimize

https://www.dcode.fr/regular-expression-simplifier

© 2022 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.

Feedback