Skip to content

search: allow escaping space for regexp search

Administrator requested to merge rvt/allow-regexp-escaping into master

Created by: rvantonder

Allows escaping spaces in the search input in regex mode: \ will search for a literal space when part of the regexp. Here is a summary of behavioral changes:

query before after
Error parsing regexp: trailing backslash at end of expression: `` Finds result for single space
\ \  Error parsing regexp: trailing backslash at end of expression: `` Finds results for two consecutive spaces
\ Error parsing regexp: trailing backslash at end of expression: `` Same error as before, change in behavior.

Thus: all existing behavior is preserved. We are simply allowing spaces to be escaped (a reasonable choice since this is valid regex), whereas previously our scanner was strict about rejecting this possibility.

Addresses #7604.

Merge request reports

Loading