Skip to content

RegEx debugging

Regular expressions are a powerful tool when you build an application that has to parse textual input. They are also useful in several other contexts. Some examples of where I’ve recently used them are:

  • Filtering tags from the output of Obsidian Dataview queries
  • Enforcing Bitbucket branch name patterns
  • Searching log files on the command line with grep
  • Parsing responses from a web application that doesn’t offer a proper REST API

And I’m sure there are plenty more use cases that didn’t come to my mind right away. But coming up with the correct regular expression can be quite challenging and they tend to break easily when the input format changes. So it comes in very handy to have a way to interactively debug a given regular expression against a test input string. The free website https://regex101.com offers such a debug tool where you can also step through the evaluation of complex regular expressions. I’ve used it multiple times in the past already and can only recommend it to everybody.

Published inCool Tools