|
85 | 85 | \\ Matches a literal backslash. |
86 | 86 |
|
87 | 87 | This module exports the following functions: |
88 | | - match Match a regular expression pattern to the beginning of a string. |
89 | | - fullmatch Match a regular expression pattern to all of a string. |
90 | | - search Search a string for the presence of a pattern. |
91 | | - sub Substitute occurrences of a pattern found in a string. |
92 | | - subn Same as sub, but also return the number of substitutions made. |
93 | | - split Split a string by the occurrences of a pattern. |
94 | | - findall Find all occurrences of a pattern in a string. |
95 | | - finditer Return an iterator yielding a match object for each match. |
96 | | - compile Compile a pattern into a RegexObject. |
97 | | - purge Clear the regular expression cache. |
98 | | - escape Backslash all non-alphanumerics in a string. |
| 88 | + match Match a regular expression pattern to the beginning of a string. |
| 89 | + search Search a string for the presence of a pattern. |
| 90 | + sub Substitute occurrences of a pattern found in a string. |
| 91 | + subn Same as sub, but also return the number of substitutions made. |
| 92 | + split Split a string by the occurrences of a pattern. |
| 93 | + findall Find all occurrences of a pattern in a string. |
| 94 | + finditer Return an iterator yielding a match object for each match. |
| 95 | + compile Compile a pattern into a RegexObject. |
| 96 | + purge Clear the regular expression cache. |
| 97 | + escape Backslash all non-alphanumerics in a string. |
99 | 98 |
|
100 | 99 | Some of the functions in this module takes flags as optional parameters: |
101 | 100 | A ASCII For string patterns, make \w, \W, \b, \B, \d, \D |
|
124 | 123 | import sre_parse |
125 | 124 |
|
126 | 125 | # public symbols |
127 | | -__all__ = [ "match", "fullmatch", "search", "sub", "subn", "split", "findall", |
| 126 | +__all__ = [ "match", "search", "sub", "subn", "split", "findall", |
128 | 127 | "compile", "purge", "template", "escape", "A", "I", "L", "M", "S", "X", |
129 | 128 | "U", "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE", |
130 | 129 | "UNICODE", "error" ] |
@@ -155,11 +154,6 @@ def match(pattern, string, flags=0): |
155 | 154 | a match object, or None if no match was found.""" |
156 | 155 | return _compile(pattern, flags).match(string) |
157 | 156 |
|
158 | | -def fullmatch(pattern, string, flags=0): |
159 | | - """Try to apply the pattern to all of the string, returning |
160 | | - a match object, or None if no match was found.""" |
161 | | - return _compile(pattern, flags).fullmatch(string) |
162 | | - |
163 | 157 | def search(pattern, string, flags=0): |
164 | 158 | """Scan through string looking for a match to the pattern, returning |
165 | 159 | a match object, or None if no match was found.""" |
|
0 commit comments