Category: Regex

JavaScript Regex

Regex course – part four. Avoiding catastrophic backtracking using lookahead

This entry is part 4 of 4 in the Regex course

Regular expressions can help us solve many different problems. They can also be the source of our headaches. A recent Cloudfare outage happened due to a regular expression that caused CPU to spike to 100% on (…) machines worldwide. In this article, we go through situations we need to watch out for like the catastrophic backtracking. To help […]

JavaScript Regex

Regex course – part one. Basic concepts.

This entry is part 1 of 4 in the Regex course

Regular expressions (regex) are sequences of characters defining a search pattern. Since it can be extremely useful in programmers everyday life, it was implemented into JavaScript. In this series of articles, I will show you how it works and what are its real-life usages. Hopefully, by the end of this part of the course, you […]