code: def checkpat(self, pattern):
          
          if pattern is None:
              return
          try:
              re.match(pattern, "")
          except re.error:
              print3("\nBad user-defined singular pattern:\n\t%s\n" % pattern)
              raise BadUserDefinedPatternError
docs: check for errors in a regex pattern