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

2
  • 1
    Does this answer your question? Retrieving parameters from a URL Commented Feb 8, 2020 at 2:10
  • Do you have any code that shows what you've tried so far? Commented Feb 8, 2020 at 2:52

1 Answer 1

0

Why not just use simple split() ?

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

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.