Wednesday, 11 October, 2017 UTC

Summary

Ilya Gelman

Sometimes we need to write or understand complex regular expressions. It might be hard to remember all the syntax tokens, especially if not dealing with RegExp on a daily basis.

There’s a great tool called Regex 101 that can ease the pain. It lets you write a regular expression and test it on example inputs, providing visual explanation of what the heck is going on. It also shows the match information for the expression so you can know what values to expect when testing a string in code.

There’s also a quick reference in case you need to refresh your memory. Just make sure you select the JavaScript “flavor” in the left sidebar.