Reputation: 67
I'm really blind about regex. I want to extract after the word 'page='
page=course; uri=%2Fcourse
page=homepage
in this case it would be "course" and "homepage". I've tried
REGEXP_EXTRACT(context, r"(?<=page=)+[a-zA-Z]*")
but it said "Cannot parse regular expression: invalid perl operator: (?<" in Google BigQuery.
Any suggestions? Thank you!
Upvotes: 0
Views: 984
Reputation: 147166
Google's regex library doesn't support lookbehinds, but you can use a capture group to get REGEXP_EXTRACT
to return that substring instead of the entire match:
REGEXP_EXTRACT(context, r"page=([a-zA-Z]+)")
Upvotes: 1