def _PrepareRegex(pattern):
  try:
    return re.compile(pattern)
  except re.error, err:
    raise errors.ParameterError("Invalid regex pattern (%s)" % err)
Compiles a regular expression.
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_PrepareRegex