Skip to content

utils: Simplify URL regex to only support one layer of parentheses

Florian Müllner requested to merge wip/fmuellner/fix-regex-lockup into master

The author of the original URL-matching regex warns[0] that the pattern may cause certain regex engines to lock up with certain input, namely patterns that contain parentheses. It turns out SpiderMonkey is affected, but rather than switching to the author's improved version (that is still crazy), sim- plify the pattern a bit by removing support for nested parentheses in URLs. Even a single pair of parentheses is extremely rare, so this is unlikely to make a noticeable difference (other than not locking up SpiderMonkey of course) ...

[0] http://daringfireball.net/2010/07/improved_regex_for_matching_urls

Fix #46 (closed)

Merge request reports