Skip to content

Review global search code regexes in Elasticsearch for accuracy

This popped up as part of gitlab-com/gl-infra/production#2318 (closed).

Upon reviewing the existing set of regexes (source), one of them seemed odd.

capture terms inside quotes, removing the quotes

This is the existing regex:

'"((?:\\"|[^"]|\\")*)"'

The duplicate literal match on \" seems off. This can probably be simplified to:

'"((?:\\"|[^"])*)"'

And the same applies to the regex following that one, for single quotes.

cc @DylanGriffith @dgruzd