def __init__(self, pattern=None, modifiers=<NUM_LIT:0>, re_object=None, re_name=None):
if not isinstance(pattern, six.string_types):<EOL><INDENT>if pattern is not None:<EOL><INDENT>raise securesystemslib.exceptions.FormatError(<EOL>repr(pattern) + '<STR_LIT>')<EOL><DEDENT><DEDENT>if re_object is None:<EOL><INDENT>if pattern is None:<EOL><INDENT>raise securesystemslib.exceptions.FormatError(<EOL>'<STR_LIT>')<EOL><DEDENT>if not pattern.endswith('<STR_LIT:$>'):<EOL><INDENT>pattern += '<STR_LIT:$>'<EOL><DEDENT>re_object = re.compile(pattern, modifiers)<EOL><DEDENT>self._re_object = re_object<EOL>if re_name is None:<EOL><INDENT>if pattern is not None:<EOL><INDENT>re_name = '<STR_LIT>' + pattern + '<STR_LIT:/>'<EOL><DEDENT>else:<EOL><INDENT>re_name = '<STR_LIT>'<EOL><DEDENT><DEDENT>self._re_name = re_name<EOL>
<Purpose>
  Create a new regular expression schema.

<Arguments>
  pattern:  The pattern to match, or None if re_object is provided.
  modifiers:  Flags to use when compiling the pattern.
  re_object:  A compiled regular expression object.
  re_name: Identifier for the regular expression object.