convert matched string to number