Get the latest tech news
Fast(er) regular expression engines in Ruby
Performance-oriented comparison of alternative regexp engines that may (or may not) speed up your Ruby code.
Beside the usual HTML parsing, sometimes we're literally forced to fall back to good 'ol regular expressions, e.g. for extracting embedded JS data. I then removed all names from the capture groups, unnecessary escapes and collapsed it to a single line (because not all regex engines support verbose mode). Filtering out regexps one by one, I found that wide scopes like[^a-zA-Z0-9_-] have the same effect as\w in Unicode mode, increasing the scan time significantly, especially if included in non-capturing(?:.)
Or read this on Hacker News