Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
What regex will match these lines?
import re data = ''' 12, 16:00:30, P , 14, ______________ ABC12345678 , N, JOE B'obby, MY COMPANY-23 / NAME, 23, , 212, 14:00:30, , 212, ______________ ABC12345678,NCh , BOB Joe Joe, MY NAME, 300, 12, 2, 13:00:30,P , 2, ______________ ABC12345678,, BOB Joe °,,,, 20 3, 15:15:00, P, 132, ______________ ABC12345678,, PHO Guy Guy °,,,, ''' rx = re.compile(r''' ^ \ *(\d+)\ *, \ *(\d+:\d+:\d+)\ *, \ *(P?)\ *, \ *(\d+)\ *, \ *([^,]+?)\ *, \ *([^,]*?)\ *, \s*([^,]+?)\ *, \ *([^,]*?)\ *, \ *(\d*)\ *, \ *(\d*)\ *, \ *(\d*)\ * $ ''', re.M | re.X) for m in rx.finditer(data): print(tuple(g for g in m.groups()))
run
|
edit
|
history
|
help
0
func1
snake game counter
counte
pytest
Circular progress bar tkinter
X
on_off
find minimum in right sorted array
Atur cara mengira luas dan isipadu sebuah trapezium
PySlots