I have the following string
http://example.com/variable/controller/id32434242423423234?param1=321¶m2=4324342
How in best way to extract id value, in this case – 32434242423423234
Regardz,
Mladjo
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could just use a regular expression, e.g.:
If you need the value as an number rather than a string, you can use
int(m.group(1)). There are plenty of other ways of doing this that might be more appropriate, depending on the larger goal of your code, but without more context it’s hard to say.