*Note:*

I didn't know what
*.compile*
was used.

*Now I do:*

http://docs.python.org/library/re.html

re.compile(*pattern*, *flags=0*)

Compile a regular expression pattern into a regular expression object, 
which can be used for matching using its 
match()<http://docs.python.org/library/re.html#re.match>and 
search() <http://docs.python.org/library/re.html#re.search> methods, 
described below.

The expression’s behaviour can be modified by specifying a *flags* value. 
Values can be any of the following variables, combined using bitwise OR 
(the | operator).

The sequence

prog = re.compile(pattern)result = prog.match(string)

 is equivalent to

result = re.match(pattern, string)

 but using re.compile() <http://docs.python.org/library/re.html#re.compile>and 
saving the resulting regular expression object for reuse is more 
efficient when the expression will be used several times in a single 
program.

-- 



Reply via email to