code: def to_unit(C, val, unit=None):
          
          md = re.match(r'^(?P<num>[\d\.]+)(?P<unit>.*)$', val)
          if md is not None:
              un = float(md.group('num')) * CSS.units[md.group('unit')]
              if unit is not None:
                  return un.asUnit(unit)
              else:
                  return un
docs: convert a string measurement to a Unum