Aggregation drilldown doesn't escape slashes within the pattern
Created by: felixfbecker
Context: https://sourcegraph.slack.com/archives/CHEKCRWKV/p1662669769229249
Simple example to reproduce:
- Query for
<title>(.*)</title>
- Click any aggregation bar
- Query becomes
/<title>(?:Group)</title>/
, which has no results
Expected: /<title>(?:Group)<\/title>/
(slash escaped), which has results
Note: Search has some heuristics to try to allow this in most cases, but I think we should still play it safe and always escape as we cannot predict all possible queries where this might or might not work.
/cc @joelkw @felixfbecker @vovakulikov