Auto-escape/fixup queries that resemble common literal queries but are invalid regexps
Created by: sqs
As a user, if I perform certain common kinds of search queries (listed below), Sourcegraph tries parsing the queries as regexps, which fails. My intent is clear, and Sourcegraph should handle these cases better, as described below.
-
myfuncname(
tomyfuncname\(
-
myarray[
tomyarray\[
Note that these fixups ONLY occur in unambiguous cases, where the query would fail to be parsed as a regexp and therefore return no results (just an error). We do not (in this issue) plan to do any auto-fixup of valid queries.
In case we missed any common cases, inspect the Sourcegraph.com search logs for regexp parse errors and add other cases to handle to this issue.
This is a partial and simpler fix for the problem described in #633 (closed).
Customers: https://app.hubspot.com/contacts/2762526/company/419771425