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 e4340f5

Browse files
authored
Create NP103.py
1 parent fb42fb4 commit e4340f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎NP103.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import re
2+
3+
s = input()
4+
# \d表示匹配数字字符,[\d-]*表示匹配任意数量的数字字符或连字符,
5+
r = re.match(r'\d[\d-]*\d', s)
6+
print(r.group()) # 提取出一部分内容

0 commit comments

Comments
(0)

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