re.DOTALL
The re.DOTALL search modifier forces the symbol . represent any character, including the newline symbol \n.
The re.DOTALL search modifier takes no arguments.
In this example we start with the following text and search pattern:
pattern = r".dog"
Note that the text includes a line break:
dogs and cats eat
By default, the search for the regular expression will not find any matches since there is no "dog" string preceded by a character: in the first line "dog" occupies the beginning of the string and in the second it is preceded by a newline symbol which does not return a match to the symbol .:
However, if the re.DOTALL argument is included, the newline symbol does return a match to the symbol .: