r/pythonhelp • u/sneekyleshy • Aug 21 '22
re.findall( regex ) find every parentheses with remix, mix or edit inside
re.findall( r"\(.*?\) title )this prints every parentheses, so far so good.
re.findall( r"\(.*?remix.*?\) title )
( bla bla ) ( bla bla remix )this matches matches multiple parentheses
re.findall( r"\(.*?(remix|mix|edit).*?\) title )only prints the word remix, mix or edit but not the rest of inside.
2
Upvotes
1
u/throwaway8u3sH0 Aug 21 '22
I think you need to surround the section you want to capture with parentheses.
Also, a star is "zero or more", so the question marks might be redundant.