So, i have this :
"( ABC,2004 )"
And I would need to extract ABC in a variable and 2004 in another.
So what I have for now is this:
In: re.compile(r'([^)]*,’).findall("(
ABC,2004 )")Out: [‘( ABC,’]
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.
If your inputs are always like that (begin with “( “, end with ” )”), you can have your values as:
This will consume any parentheses at the edges inside the outer parentheses.
Also, if the commas can be surrounded/succeeded by spaces, you can: