Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Repeated match within another regular expression
a=['starts in 09h 05m 33s','ends in 00h 33m 12s'] import re r1 = re.compile(r'(starts|ends)') r2 = re.compile(r'(\d{2})[hms]') for s in a: m1 = r1.match(s) if m1: m2 = r2.findall(s) print(m1.group(0), m2[0], m2[1], m2[2])
run
|
edit
|
history
|
help
0
convert hours into min
Get count
WORD THING
contoh 3.1
Hello world
Finding avg value on list
Assignment-3a
Lesson 8 updated
circle
19.09.18