def __init__( self, pattern, flags=<NUM_LIT:0>):
super(Regex,self).__init__()<EOL>if len(pattern) == <NUM_LIT:0>:<EOL><INDENT>warnings.warn("<STR_LIT>",<EOL>SyntaxWarning, stacklevel=<NUM_LIT:2>)<EOL><DEDENT>self.pattern = pattern<EOL>self.flags = flags<EOL>try:<EOL><INDENT>self.re = re.compile(self.pattern, self.flags)<EOL>self.reString = self.pattern<EOL><DEDENT>except sre_constants.error:<EOL><INDENT>warnings.warn("<STR_LIT>" % pattern,<EOL>SyntaxWarning, stacklevel=<NUM_LIT:2>)<EOL>raise<EOL><DEDENT>self.name = _ustr(self)<EOL>self.errmsg = "<STR_LIT>" + self.name<EOL>self.mayIndexError = False<EOL>self.mayReturnEmpty = True<EOL>
The parameters pattern and flags are passed to the re.compile() function as-is. See the Python re module for an explanation of the acceptable patterns and flags.