def __init__(self, pattern=None, modifiers=0, re_object=None, re_name=None):
    """
    <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.
    """

    if not isinstance(pattern, six.string_types):
      if pattern is not None:
        raise securesystemslib.exceptions.FormatError(
            repr(pattern) + ' is not a string.')

    if re_object is None:
      if pattern is None:
        raise securesystemslib.exceptions.FormatError(
            'Cannot compare against an unset regular expression')

      if not pattern.endswith('$'):
        pattern += '$'
      re_object = re.compile(pattern, modifiers)
    self._re_object = re_object

    if re_name is None:
      if pattern is not None:
        re_name = 'pattern /' + pattern + '/'

      else:
        re_name = 'pattern'
    self._re_name = re_name
def __init__ ( self , pattern = None , modifiers = 0 , re_object = None , re_name = None ) : if not isinstance ( pattern , six . string_types ) : if pattern is not None : raise securesystemslib . exceptions . FormatError ( repr ( pattern ) + ' is not a string.' ) if re_object is None : if pattern is None : raise securesystemslib . exceptions . FormatError ( 'Cannot compare against an unset regular expression' ) if not pattern . endswith ( '$' ) : pattern += '$' re_object = re . compile ( pattern , modifiers ) self . _re_object = re_object if re_name is None : if pattern is not None : re_name = 'pattern /' + pattern + '/' else : re_name = 'pattern' self . _re_name = re_name
<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.