Morgan Allen Morgan Allen - 1 year ago 74
Python Question

Python Regex matching word inside words

I've been reading the documentation but can't find what I'm looking for.

I'm simply trying to match

foo
inside
foobar
but can't seem to see how to do it. Any guidance would be helpful!

Answer Source

Use parenthesis Like re.findall("(foo)bar","foobar foogy woogy")