def _compile ( pattern , flags ) : return re . compile ( WcParse ( pattern , flags & FLAG_MASK ) . parse ( ) )
python compile regex with flag
Compile the pattern to regex .
def _compile(pattern, flags):
    """Compile the pattern to regex."""

    return re.compile(WcParse(pattern, flags & FLAG_MASK).parse())