Go to books ↓
Regular expressions are powerful, but with great power comes great responsibility. Because of the way most regex engines work, it is surprisingly easy to construct a regular expression that can take a very long time to run.
If you want to use regular expressions in production code the most important thing you must know about how these things are matched is that there are three general approaches to doing it. They have different performance characteristics and it is absolutely vital that you know which approach the library you are using implements.
Regular expressions can be tricky to write and downright impossible to read. They can also be incredibly useful. Striking a balance between power and legibility is achievable. Here are five of the best ways I know to do it.
A look at regular expressions in and after ES6. There’s a couple of regular expressions flags which were introduced in ES6: the /y or sticky flag, and the /u or Unicode flag.