State machines

Vaguely reassuring state machines is a Bluesky account that posts a finite state machine every day. The aim of this page is to craft a regular expression that matches the state machine — which, it turns out, is easy to screw up. So it’s nice to have somewhere to write a quick test suite.

Everything here runs in your browser and is saved to local storage, so your work sticks around between visits. The Share button copies a link that carries your regex and test cases with it.

FAQ#

What is this? What am I trying to do?

The image is a representation of a finite state machine. The aim is to craft a regular expression that will match the state machine. These should start at the left hand side, and should only be valid if they terminate at a double circle.

Why am I trying to do this?

Well, because they’re vaguely reassuring somehow. Let me know if you work out how they pull this off.

How can I use it?

Add example patterns that should be valid to the valid box and invalid to the invalid, and start writing your regex.

…uch, this isn’t PCRE!

That’s not a question!

Who runs vaguely reassuring state machines?

Kate!

Who made this page?

I’m Doug!