Suppose I see a line of code like
I tried
Is there a way of printing out all of the groups in the above scenario?
I now think that it is not possible, because groups is a method that searches for a regex, rather than being a list.
elif m.group('status').lower() in ['stopped', 'failed']:And I want to see all statuses that are available.
I tried
logging.warning('m.groups = ' + ' '.join(str(m.group)))But I get
Output:TypeError: type object argument after * must be an iterable, not builtin_function_or_method
I have tried several methods, but I always get either the error message above or Output:m.groups = < b u i l t - i n m e t h o d g r o u p o f r e . M a t c h o b j e c t a t 0 x 7 f b 2 7 0 a 4 7 1 8 8 >
which is not what I'm looking for.Is there a way of printing out all of the groups in the above scenario?
I now think that it is not possible, because groups is a method that searches for a regex, rather than being a list.