-1

I have URL like
https://some-domain/auth/authenticate?auth=1c4cf948-0867-488d-8596&client_id=account&tab_id=0p-SoVza1Sw
I want to get the value of tab_id by using regex.
I have done it through JS but I want a regEx to return 0p-SoVza1Sw.
I tried this /tab_id=([^&]+)&*/g but it matches with tab word also

I know it would be easy but am not good at regex, Thank you

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
Rohit Ambre
  • 921
  • 1
  • 11
  • 25

1 Answers1

0

You could use a lookbehind assertion here:

(?<=[?&]tab_id=)[^&]+

Demo

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360