search frontend: update scanner to recognize standard interpretation
Created by: rvantonder
Implementing RFC 675 means that it's possible to have literal and regex patterns in the same string. When this happens, we want the frontend to know whether it scans a regex pattern /xyz/
versus a literal pattern abc
. This PR updates the scanner to tag /xyz/
patterns as regex, and literals otherwise. This'll let us support contextual highlighting (will add in follow up PR).
Another way to phrase this: If we don't add this distinction then we either have to give up highlighting regex metasyntax altogether (bad, since we are now explicitly introducing regex support with RFC 675, so could lead to confusion) or incorrectly highlight all syntax (including literals) as regex, which is also bad, because that's just wrong.
Test plan
Added a test.
App preview:
Check out the client app preview documentation to learn more.