Catastrophic backtracking shouldn’t be happening on this regex
EDIT: Added Java version at end — despite being inherently clumsy, unreadable, and unmaintainable. ¡No More Ugly Patterns! The first thing you need to do is to write your regex in a way that can stand any possible hope of being readable — and consequently maintainable — by human beings. The second thing you need … Read more