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
  • 165,386
  • 8
  • 154
  • 230
Tom
  • 33,626
  • 31
  • 85
  • 109

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
  • 20,375
  • 4
  • 36
  • 77