Building regex.help

submited by
Style Pass
2021-05-21 20:30:06

Now that regex.help is functional and deployed (check it out if you’re writing regular expressions) I want to share how I built it. In the text post will cover deployment and CI/CD setup. In case you want to look at the code, head over to the GitHub repo.

First: what is regex.help? It’s a web interface for grex, which basically writes regex for you. Given a couple of example strings you want to match, grex will generate a regular expression matching all of them. That’s pretty much it, although quoting the README: “often, the resulting expression is still longer or more complex than it needs to be” so you might want to adjust it by hand. You can do that interactively on regex.help while getting real-time feedback for each of the examples you specified.

This is the second side-project I’ve built using Elixir, Phoenix and LiveView (the first one was Secretwords). The stack is pretty much the same, including Tailwind for CSS. I was hoping I’ll have a use case for Alpine.js to close the loop and use the entire PETAL stack, alas, there was no need for any custom JS this time either.

Leave a Comment