from typing import Any, Pattern, Union

def str_flags_to_int(str_flags: str) -> int: ...

class Regex:
    @classmethod
    def from_native(cls, regex: Pattern) -> Regex: ...
    pattern: Union[str, bytes] = ...
    flags: int = ...
    def __init__(self, pattern: Union[str, bytes], flags: Union[str, int] = ...) -> None: ...
    def __eq__(self, other: Any) -> bool: ...
    __hash__: Any = ...
    def __ne__(self, other: Any) -> bool: ...
    def try_compile(self) -> Pattern: ...
