regex: match one vs. many
5 Feb
2021
5 Feb
'21
12:35 p.m.
Hi, I was reading the documentation on https://docs.python.org/3/howto/regex.html yesterday to solve a regex problem with python. My regex result would match several times (i.e. have several groups) but match() and search() would only give me one hit. I first thought it was my fault because I was using trying to match a group several times with (expr)+ and learned about a common mistake where only the last matched group is returned. Turns out that it was the destinction between match/search returning one Match object and findall/finditer returning several. The information is in the docs but maybe it's helpful to make that a bit clearer. Thanks! Sebastian
1169
Age (days ago)
1169
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sebastian Krämer