Reputation: 127
I want to extract a set of characters between "u1=" and the first semi-colon using a regex. For instance, given the following string: id=1w54;name=nick;u1=blue;u2=male;u3=ohio;u5=
The desired regex output should be just blue
.
I tested (?<=u1=)[^;]*
on https://regex101.com and it works. However, when I run this in BigQuery, using regexp_extract(string, '(?<=u1=)[^;]*')
, I get an error that reads "Cannot parse regular expression: invalid perl operator: (?<"
I'm confused why this isn't working in BQ. Any help would be appreciated.
Upvotes: 0
Views: 1772
Reputation: 1269553
You can use regexp_extract()
like this:
regexp_extract(string, 'u1=([^;]+)')
Upvotes: 2