Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1_homework_安晓东
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
安晓东
1_homework_安晓东
Commits
621626e7
Commit
621626e7
authored
Jan 08, 2019
by
安晓东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete test2.py
parent
d177b119
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
45 deletions
+0
-45
homework_02/test2.py
+0
-45
No files found.
homework_02/test2.py
deleted
100644 → 0
View file @
d177b119
import
re
# reg = "hellofdsaa4544f@wangscaihello"
# h = re.findall('[a-z]{4}', reg)
# print(h)
io
=
'1324.231.432.1234,192.168.1.6,10.25.11.8这些信息中,哪些是ip呢'
# ip = 'this is ip:192.168.1.234;192.145.56.788'
j
=
re
.
findall
(
r"^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$"
,
io
)
print
(
j
)
# reg = '(\d{1,3}.){3}\d{1,3}'
# h = re.search(reg, ip)[0]
# print(h)
#
# info = 'pytoppppytofdsaf'
# f = re.findall('pyto+?', info)
# print(f)
# f = re.findall('pyto*?', info)
# print(f)
# f = re.findall('pyto??', info)
# print(f)
# s = '下边的号码中,哪些是手机号呢:18475309876,18719462345,17665148777,13332839908,12398028761'
# h = re.findall('\d{11}',s)
# print(h)
# def test(f):
# h = re.findall('\d{11}', f)
# for i in h:
# reg = '^((18[4,7])|(17[1,6])|(13[3,8]))\d{8}$'
# h = re.findall(reg, i)
# if h:
# print('匹配成功')
# print(i)
# else:
# print('匹配失败')
#
#
# test('下边的号码中,哪些是手机号呢:18475309876,18719462345,17665148777,13332839908,12398028761')
# j = '42197393里包含几个数字啊'
# h = len(re.findall('\d', j))
# def test(f):
# j = len(re.findall('\d', f))
# return j
# print(test('42197543543543543里包含几个数字啊'))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment