Advertisement
defango

query-v0.1

Dec 23rd, 2017
1,611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. SELECT
  2. f.repo_name
  3. f.path,
  4. c.pkey
  5. FROM
  6. [bigquery-public-data:github_repos.files} f
  7. //Query all matches for id that fits the key parameters.//
  8. JOIN (
  9. SELECT
  10. id,
  11. REGEXP_EXTRACT(content, r'(?:^|[^a-zA-Z0=9])(5[HJK][123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ]{48,49})(?:$|[^a-zA-Z0-9])') AS pkey
  12. FROM
  13. [bigquery-public-data:github_repos.contents]
  14. WHERE
  15. REGEXP_MATCH(content, r'(?:^|[^a-zA-Z0=9])(5[HJK][123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ]{48,49})(?:$|[^a-zA-Z0-9])') c
  16. ON
  17. f.id = c.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement