I have the folowing string
'TOKEN a$dmin\r\n'
And I would like to extract the value 'a$dmin' from it. I’m using
re.findall("(?i)TOKEN (.*)",string)
but what I’m getting is 'a$dmin\r\n'
How do I do this correctly?
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.
Either match against
str.strip:or change the expression to match only non-spaces:
In case you have literal slashes, as in:
use this expression to match everything before the first slash: