Regular expressions in JavaScript may not always be intuitive. I aim to provide some clarity by providing examples about things I have found myself getting stuck on. This post covers a few topics including state in regular expressions, regular expression performance and various things that have tripped me up. regular expressions are stateful Regular expression objects maintain state. For example,