'Explicity convert a string to a numeric value'

def _cast_numeric(self, value):

    if NUMBER_REGEX.match(value):
        try:
            return int(value)
        except ValueError:
            return float(value)
