@mdione I see nothing wrong here.
You could do (this_will_not_match)? instead of () to prove that it's legit, but I would stick with ()
@mdione I see nothing wrong here.
You could do (this_will_not_match)? instead of () to prove that it's legit, but I would stick with ()
@mdione can you also not just `len(r.match(‘foo’).groups())` and then do conditional logic with the len return?
Only reason why I would suggest that is what you’re doing visually looks strange and might be hard to remember why you were even doing it in the future. I say this as someone who has done this to themselves plenty lol
@chrysn yeah, no, not even my hack fixed it. The truth is, it was something like `(?:(moo)(foo)(bar)(quux)|()(foo)()())`, but when calling `match().groups()` I would either get:
`['moo', 'foo', 'bar', 'quux', None, None, None, None]` or
`[None, None, None, None, '', 'foo', '', '']`
instead of
`['moo', 'foo', 'bar', 'quux']` or
`['', 'foo', '', '']`
as I expected. The resulting code was even worse :)