diff --git a/docs/regex.html b/docs/regex.html index 65078706..6b89de9e 100644 --- a/docs/regex.html +++ b/docs/regex.html @@ -1339,7 +1339,7 @@ -
表达式 | 匹配示例 |
---|---|
.ar | The car par ked in the gar age. |
ar[.] | A garage is a good place to park a car . |
表达式 | 匹配示例 |
---|---|
.ar | The car par gar age. |
ar[.] | A garage is a good place to park a car . |
方括号的句号就表示句号。表达式 ar[.]
匹配 ar.
字符串
表达式 | 匹配示例 |
---|---|
[a-z]* | The car parked in the garage #21. |
\s*cat\s* | The fat cat sat on the concat enation. |
表达式 | 匹配示例 |
---|---|
[a-z]* | The car parked in the garage |
\s*cat\s* | The fat cat sat on the concat enation. |
表达式 [a-z]*
匹配一个行中所有以小写字母开头的字符串。
+
号表达式 | 匹配示例 |
---|---|
[0-9]{2,3} | The number was 9.999 7 but we rounded it off to 10 .0. |
[0-9]{2,} | The number was 9.9997 but we rounded it off to 10 .0. |
[0-9]{3} | The number was 9.999 7 but we rounded it off to 10.0. |
表达式 | 匹配示例 |
---|---|
[0-9]{2,3} | The number was 9.999 7 but we rounded it off to 10 .0. |
[0-9]{2,} | The number was 9.9997 but we rounded it off to 10 .0. |
[0-9]{3} | The number was 9.999 7 but we rounded it off to 10.0. |
(...)
特征标群函数 | 说明 |
---|---|
re.findall | 返回包含所有匹配项的列表 |
re.finditer | 返回一个可迭代的匹配对象(每个匹配一个) |
re.search | 如果字符串中的任何位置存在匹配项,则返回 Match 对象 |
re.split | 返回一个列表,其中字符串在每次匹配时被拆分 |
re.sub | 用字符串替换一个或多个匹配项 |
re.compile | 编译正则表达式模式供以后使用 |
re.escape | 返回所有非字母数字反斜杠的字符串 |
函数 | 说明 |
---|---|
re.findall | 返回包含所有匹配项的列表 |
re.finditer | 返回一个可迭代的匹配对象 (每个匹配一个) |
re.search | 如果字符串中的任何位置存在匹配项,则返回 Match 对象 |
re.split | 返回一个列表,其中字符串在每次匹配时被拆分 |
re.sub | 用字符串替换一个或多个匹配项 |
re.compile | 编译正则表达式模式供以后使用 |
re.escape | 返回所有非字母数字反斜杠的字符串 |