How to get all the numbers in a similar record: string(1,-2,5*(4-2)) ?
I tried this: re.sub("([+-]?\d+(?:\.\d+)?)","found",s) , but the entry ignores brackets.
So how to get all the positive, negative and numbers in brackets between string() .
How to get all the numbers in a similar record: string(1,-2,5*(4-2)) ?
I tried this: re.sub("([+-]?\d+(?:\.\d+)?)","found",s) , but the entry ignores brackets.
So how to get all the positive, negative and numbers in brackets between string() .
Source: https://ru.stackoverflow.com/questions/722810/
All Articles
[-]?\d+works this way, or do we need to distinguish them somehow by parentheses? - slippykre.findall('[-]?\d+', re.findall('\(([^)]+\(?)*[^(]+\)', s)[0]). One expression does not it turned out - slippyk