Previously, we collected all URL matches and then searched through them.
Now, we search lazily, which should improve performance.
I added a perf test that repeats a URL a million times. The new code
finishes in ~0.001 seconds on my machine. The old code does not finish.