nl: raise an TypeError exception with an argument string "If the flags are set, regex must be a regular expression string.".
code: raise TypeError ( "If the flags are set, regex must be a regular expression string." )