I'm still new to all this and as I'm learning I tend to spend a lot of time in the terminal with dir(). However I have tried 100x ways to get it to display the groups() function or anything similar for regex.
There's a whole list of methods and attributes for Match Objects and I don't know how to print the directory of these methods and attributes on my screen.
I'm following a course where you learn as you program basically, as a newbie. I like to follow the tutorial and program as it goes and then I try to program it again from memory and I use dir() and help() to spark my memory and get me going. But I don't really know much about objects and how to display general methods that can be used on objects.
Thanks for the help, I should have asked this question hours ago instead of repeatedly going through the rabbit hole of dir() and trying to figure out inspect() too. If I can just trace my way to a list of the methods, specifically groups() I'll be happy.
This is all that shows up for me.
>>> import re >>> dir(re) ['DEBUG', 'DOTALL', 'I', 'IGNORECASE', 'L', 'LOCALE', 'M', 'MULTILINE', 'S', 'Scanner', 'T', 'TEMPLATE', 'U', 'UNICODE', 'VERBOSE', 'X', '_MAXCACHE', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__version__', '_alphanum', '_cache', '_cache_repl', '_compile', '_compile_repl', '_expand', '_locale', '_pattern_type', '_pickle', '_subx', 'compile', 'copy_reg', 'error', 'escape', 'findall', 'finditer', 'match', 'purge', 'search', 'split', 'sre_compile', 'sre_parse', 'sub', 'subn', 'sys', 'template'] >>> dir(re.Match) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'Match'