import re


def _GenerateSensitiveWordsRe(words):
  """Returns the regexp for matching sensitive words.

  Args:
    words: A sequence of strings.

  Returns:
    A pattern object, matching any of the given words. If words is empty,
    returns None.
  """
  if not words:
    return None
  union = []
  for word in words:
    union.append(word)
    union.append(word.capitalize())
    union.append(word.upper())
  return re.compile(u'(%s)' % u'|'.join(union))