the python re module the python re module the python re module is the built-in module provided by python for working with regular expressions you might also like to examine the third party regex module (see org/project/regexwhich is backwards compatible with the default re module but provides additional functionality working with python regular expressions using raw strings an important point to note about many of the strings used to define the regular expression patterns is that they are preceded by an 'rfor example '/bin/sh$the 'rbefore the string indicates that the string should be treated as raw string raw string is python string in which all characters are treated as exactly thatindividual characters it means that backslash ('\'is treated as literal character rather than as special character that is used to escape the next character for examplein standard string '\nis treated as special character representing newlinethus if we wrote the followings 'hello \ worldprint(swe will get as outputhello world howeverif we prefix the string with an 'rthen we are telling python to treat it as raw string for examples 'hello \ worldprint(sthe output is now hello \ world this is important for regular expression as characters such as backslash ('\'are used within patterns to have special regular expression meaning and thus we do not want python to process them in the normal way