Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 446b6b9

Browse files
authored
Merge pull request #15 from Ann-Holmes/patch-2
Update 06 - 正则表达式 提取数据.md
2 parents aa0238a + 27febfe commit 446b6b9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎06 - 正则表达式 提取数据.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,19 @@ import re
259259

260260
match_obj = re.match("hello\Sworld", "hello&world")
261261
if match_obj:
262-
result = match_obj.group()
263-
print(result)
262+
result = match_obj.group()
263+
print(result)
264264
else:
265-
print("匹配失败")
265+
print("匹配失败")
266266

267267

268268

269269
match_obj = re.match("hello\Sworld", "hello$world")
270270
if match_obj:
271-
result = match_obj.group()
272-
print(result)
271+
result = match_obj.group()
272+
print(result)
273273
else:
274-
print("匹配失败")
274+
print("匹配失败")
275275
```
276276

277277
运行结果:
@@ -740,4 +740,4 @@ pattern = re.compile(r'<input type="submit" id="(.*?)" value="(.*?)" class="bg s
740740

741741
result = pattern.findall(string)
742742
print(result)
743-
```
743+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /