PERF: avoid lookbehinds when indexing search (PR #10862)

Previously we used a EmailCook.url_regexp this regex used lookbehinds

Unfortunately certain strings could lead to pathological behavior causing CPU to skyrocket and regex replace to take a very very long time.

EmailCook still needs a fix, but it is less urgent cause it already splits to single lines. That said we will correct that as well in a seperate PR.

New implementation is far more naive and relies on the extra spaces search indexer inserts.

GitHub

          # don't fail if uri does not parse

I think this line is safe to remove since it isn’t being used.

While we’re at it :stuck_out_tongue: https://github.com/discourse/discourse/pull/10862/files#r501383631

Same here too https://github.com/discourse/discourse/pull/10862/files#r501383631

probably, we can try that… I was just fixing complaints from my linter.

pushed changes for both

done

LGTM :+1: