Closed lookslikeitsnot closed 1 year ago
Having flags as parameters for BigQuery instead of having them in the test pattern has a few advantages such as
However, it adds a few lines of code so it's going to be more work to maintain.
Note In the PR, adding flags both as parameters and in the test pattern doesn't cause execution errors. The flags in the pattern take precedence over the ones in the flag (which is expected flag behavior).
e.g.:
regex: (?i)[A-Z]
(case-insensitive letter match)
flags: -i
(case-sensitive match)
will be translated to (?-i)(?i)[A-Z]
and match any lower- or upper-case character.
Closed via #253
Is your feature request related to a problem? Please describe. For consistency sake since we already support flags for Postgres and Snowflake; and since the project description states it supports BigQuery, I believe it makes sense to add support for re2 flags in BigQuery regex matches .
Describe the solution you'd like Although BigQuery doesn't support flags as regex function parameters, it uses re2 and re2 supports flags by in-lining the flags (prepending the regex with
(?flag)
).Additional context This is a follow-up on issue #245 that added support for flags in Postgres, Snowflake, and Redshift. The idea was briefly introduced here