① Define regex
Enter a regular expression into the input field below or click Generate random regex to have the app generate a simple regex randomly for you.
A valid regex consists of alphanumeric characters representing the set of input symbols (e.g.
$ character representing the empty string, the choice operator
+, the Kleene operator
*, and parentheses
). An example of a valid regex is:
② Simplify regex
Click Simplify step to perform one simplification step, and Simplify full to perform simplification until the end.
Using set algebra and FSM equivalence laws, regex simplification reduces the length of the regex definition string while not changing the language that the regex defines.
For example, the regex
(a+aa)* defines the same language as the regex
③ Simplification history
For each simplification step, the application gives the regex strings before and after the simplification step, and the generic rule that was used to perform the step. Furthermore, the application highlights the characters that were deleted in each simplification step.
④ What's next?
This is just the beginning! If you like learning about and playing with FSMs and regexes, check out these other Web apps:
- FSM simulator - A Web app that visually simulates the step-by-step execution of finite-state machines.
- FSM2Regex - A Web app that converts finite-state machines to regular expressions and regular expressions to finite-state machines.
- Regexper - A Web app that displays regular expressions as railroad diagrams.
- Grammophone - A Web app for analyzing and transforming context-free grammars, e.g. for generating strings from a grammar and computing SLR/LR/LALR parsing tables.
- Debuggex - A Web app that is a visual regular expression debugger, tester, and helper.
Love the application, hate it, found a bug, or have a feature idea? I'd love to hear about it! Please send your feedback via the noam project issues page on GitHub.