import re


def angle_udf(angle):
    """Converts DMS notation to degrees. Return None if not in DMS or degrees notation."""
    if not angle:
        return None

    dms = re.match(r'(-?\d*).(-?\d*)\'(-?\d*)"', angle)
    if dms:
        return int(dms[1]) + int(dms[2]) / 60 + int(dms[3]) / (60 * 60)

    degrees = re.match(r"\d*.\d*", angle)
    if degrees:
        return float(degrees[0])