sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.11k stars 1.29k forks source link

Do up-front validation of the regexp dialect that PSQL recognizes #30149

Open rvantonder opened 2 years ago

rvantonder commented 2 years ago

We throw hard errors for these patterns:

repo:(?i:sup)

(?i:sup) type:repo

We're assuming that validating the regex against RE2 with re.Compile would be OK when we made the type:repo behavior change, but the newest discovery is that (?i:pattern) syntax is OK for re.Compile but not for PSQL. We should check this up front, so that we can decide whether to run a repo search, and/or warn. But throwing hard errors is no bueno.

github-actions[bot] commented 2 years ago

Heads up @jjeffwarner - the "team/search-core" label was applied to this issue.

github-actions[bot] commented 2 years ago

Heads up @benvenker @lguychard - the "team/search-product" label was applied to this issue.

stefanhengl commented 9 months ago

I can still reproduce this

image