I have a string in variable a as below:
a = 'foo(123456) together with foo(2468)'
I would like to use "re" to extract both foo(123456) and foo(2468) from the string.
I have two questions:
- What is the correct regex to be used?
foo(.\*)doesn't seem to work, as it treats123456)together withfoo(2468as.* - How to extract both foo?