how to know all methods in a module in python

>>> import re
>>> dir(re)

Here is what the above code is Doing:
1. We are importing the re module.
2. We are printing all the functions and variables defined in the re module.

As you can see, there are quite a few functions and variables defined in the re module.

We will now look at some of the most commonly used functions in the re module.