Morgan Allen Morgan Allen - 2 months ago 10
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

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