2 # Ron Murawski <ron@horizonchess.com>
\r
3 # 'bytes' support added by Jukka Lehtosalo
\r
5 # based on: http: //docs.python.org/2.7/library/re.html
\r
8 List, Iterator, overload, Callable, Tuple, Sequence, Dict,
\r
9 Generic, AnyStr, Match, Pattern, Any, Optional, Union
\r
12 # ----- re variables and constants -----
\r
29 class error(Exception): ...
\r
32 def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...
\r
34 def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
\r
37 def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
\r
39 def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
\r
42 def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
\r
44 def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
\r
47 def split(pattern: Union[str, unicode], string: AnyStr,
\r
48 maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
\r
50 def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
\r
51 maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
\r
54 def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ...
\r
56 def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ...
\r
58 # Return an iterator yielding match objects over all non-overlapping matches
\r
59 # for the RE pattern in string. The string is scanned left-to-right, and
\r
60 # matches are returned in the order found. Empty matches are included in the
\r
61 # result unless they touch the beginning of another match.
\r
63 def finditer(pattern: Union[str, unicode], string: AnyStr,
\r
64 flags: int = ...) -> Iterator[Match[AnyStr]]: ...
\r
66 def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
\r
67 flags: int = ...) -> Iterator[Match[AnyStr]]: ...
\r
70 def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,
\r
71 flags: int = ...) -> AnyStr: ...
\r
73 def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
\r
74 string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
\r
76 def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
\r
77 flags: int = ...) -> AnyStr: ...
\r
79 def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
\r
80 string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
\r
83 def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,
\r
84 flags: int = ...) -> Tuple[AnyStr, int]: ...
\r
86 def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
\r
87 string: AnyStr, count: int = ...,
\r
88 flags: int = ...) -> Tuple[AnyStr, int]: ...
\r
90 def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
\r
91 flags: int = ...) -> Tuple[AnyStr, int]: ...
\r
93 def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
\r
94 string: AnyStr, count: int = ...,
\r
95 flags: int = ...) -> Tuple[AnyStr, int]: ...
\r
97 def escape(string: AnyStr) -> AnyStr: ...
\r
99 def purge() -> None: ...
\r
100 def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ...
\r