'Build regular expression object from state.
Returns:
Compiled regular expression based on internal value.'

def __Compile(self):

    regex = self.__BuildRegex()
    try:
        return re.compile(regex)
    except re.error as e:
        raise ValidationError(("Value    '%s'    for    %s    does    not    compile:    %s" % (regex, self.__key, e)), e)
