public static function parseString($source, $matchRules)
    {
        foreach ((array) $matchRules as $matchRule) {
            if (is_callable($matchRule) === true) {
                return call_user_func($matchRule, $source);
            } else {
                if (preg_match($matchRule, $source, $matches) === 1) {
                    $value = $matches['integral'];
                    if (isset($matches['fractional'])) {
                        $value .= '.' . $matches['fractional'];
                    }
                    return (double) $value;
                }
            }
        }
        return false;
    }