I am using dataset of github to extract all paths after /api/* and for that I used this below-mentioned query. However, the results are not what I expected it to be. If the regex is wrong can someone please correct it?
Expected results:
/api/v1/user
/api/anything/anything
What actually returns:
- Frameworks/TwitterKit.framework/Resources
- doc/source/README.rst
*
FROM
`bigquery-public-data.github_repos.files`
WHERE
(REGEXP_CONTAINS(path,r'(s|^.*/api/([^/]*)(?:/.*)?$|$1|)'))
LIMIT
100```
REGEXP_CONTAINS(path, r'^/api/[^/]*(?:/.*)?$')