Is there any benefit in using compile for regular expressions in Python?
h = re.compile(\'hello\') h.match(\'hello world\')
vs
Regular Expressions are compiled before being used when using the second version. If you are going to executing it many times it is definatly better to compile it first. If not compiling every time you match for one off's is fine.