pymel.util.common.escape

escape(pattern)

Escape all non-alphanumeric characters in pattern.