① Create automaton
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. Next, click Create automaton to create a FSM for the defined regex and display its transition graph.
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:
Enter a FSM into the input field below or click Generate random DFA/NFA/eNFA to have the app generate a simple FSM randomly for you. Next, click Create automaton to display the FSM's transition graph.
A valid FSM definition contains a list of states, symbols and transitions, the initial state and the accepting states. States and symbols are alphanumeric character strings and can not overlap. Transitions have the format:
$ character is used to represent the empty string symbol (epsilon) but should not be listed in the alphabet. Generate a FSM to see a valid example.
② Simulate automaton
Enter a sequence of input symbols into the input field below or click Random string, Acceptable string and Unacceptable string to have the app generate random acceptable and unacceptable sequences for you.
Click Read next to have the FSM consume the next input symbol in the sequence and Read all to consume all remaining input symbols. Click Step backward to go back one symbol and Reset to reset the FSM and go back to the beginning of the input sequence.
The input field highlights the input symbol that will be read next.
③ Transition graph
The FSM being simulated is displayed in the form of a transition graph. The nodes representing the current states of the FSM are colored in .
④ 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:
- Regular Expressions Gym - A Web app that simplifies your regular expressions by detecting and removing sub-expressions that generate the same strings.
- 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.