I am trying to query the stackoverflow data in BigQuery. I would like to use the REGEXP_CONTAINS
function to pull all questions with the r
tag. The tags
column is a pipe delimited field that contains all of the tags associated with each question. A sample of what that looks like is below:
I can't seem get a regex that works.
I am almost there with \|?(r)\|?
. This will work for:
r
sql|r|python
c
vba|r
r|java
But it will also return things like:
ruby
angular|c|vba
...which I don't want.
I need to somehow have a regex that will pull r
all alone unless it has a pipe on either side.