简体   繁体   中英

Google BigQuery extract string from column with regexp_extract

I need to extract the app_id from the following string in the column below:

&app_id=4.25.9&

so anything that starts with &app_id= and ends with &

Any ideas on how to write this example? The number of characters and symbols may differ.

This should be sufficient:

REGEXP_EXTRACT(your_column, r'\&app_id=(.+?)\&')

The app id matching right now .+? is a little broad and will match any character, you may want to restrict it further.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM