0

I have strings that looks like this.

setting-bs_b77f423715d2b991-node
setting-bs_b77f423715d2b991-eggs
setting-bs_b77f423715d2b991-cheese
setting-bs_b14835f519bf447d-ham

How do I extract just the middle element? e.g. bs_b14835f519bf447dit is always the same length and always has the same bs_ prefix.

I unfortunately cannot use a lookbehind for this problem, as suggested in this answer as the regex must run inside bigquery which does not support lookbehinds

Mikhail Berlyant
  • 146,425
  • 8
  • 116
  • 187
Tom
  • 32,434
  • 31
  • 83
  • 105

1 Answers1

1

Assuming you have no other 16-char alphanumeric words then [a-z0-9]{16} could work.

https://regex101.com/r/6vhSH6/1

MonkeyZeus
  • 19,651
  • 3
  • 32
  • 72