Returns a match object or None:

Convenience function for checking if string matches a specific rule.

If regex is available, any rule is supported; with re , rule must be ‘IRI_reference’ or some special case thereof (‘IRI’, ‘absolute_IRI’, ‘irelative_ref’, ‘irelative_part’, ‘URI_reference’, ‘URI’, ‘absolute_URI’, ‘relative_ref’, ‘relative_part’).

If rule is None, parse an IRI_reference without validation .

Parses string according to rule into a dict of subcomponents.

If return_parts is True, returns a dict of named parts instead of a string.

Resolves an URI reference relative to a base URI.

For parsing, some subcomponents are captured in named groups (only if regex is available, otherwise see parse ):

On narrow builds, non-BMP characters are (incorrectly) excluded:

Returns a compiled pattern object for a rule name or template string.

Returns a dict of patterns (regular expressions) keyed by rule names for URIs and rule names for IRIs.

See also the module level dicts of patterns, and get_compiled_pattern .

To wrap a rule in a named capture group, pass it as keyword argument: rule_name=’group_name’. By default, the formatted patterns contain no named groups.

Patterns are str instances (be it in python 2.x or 3.x) containing ASCII characters only.

Caveats: