0

URL example = 'https://stackoverflow.com/questions/ask?newreg=12f6529a5b3449c3be1d14458a4657ef'

i want to return the barcode number after ''newreg' in the URL. The string is not same len everytime

Would appreciate any help here

Thanks

  • 1
    Does this answer your question? [Retrieving parameters from a URL](https://stackoverflow.com/questions/5074803/retrieving-parameters-from-a-url) – Tom Feb 08 '20 at 02:10
  • Do you have any code that shows what you've tried so far? – Z4-tier Feb 08 '20 at 02:52

1 Answers1

0

Why not just use simple split() ?

url = 'https://stackoverflow.com/questions/ask?newreg=12f6529a5b3449c3be1d14458a4657ef'
barcode = url.split('=')[-1]

Hope this helps!

hod
  • 750
  • 7
  • 21