What does python's "re.compile" do?

python, regex

Solution

It compiles a regex into a regex object. Take a look at the docs for more info.

Problem

When you run re.match for the original string and the string that was passed through re.compile, how is the latter different? What happened to the string that was passed through re.compile?

Original source

Related problems