public function regexps(array $regexpsMap)
    {
        return function(FieldExpression $expr, $compiler) use ($regexpsMap)
        {
            $value = $expr->getValue();

            foreach ($regexpsMap as $regexp => $transformation) {
                if (preg_match($regexp, $value))
                    return $transformation($expr, $compiler);
            }

            throw new UnregisteredTransformationException("There is no transformation matching the value \"$value\"");
        };
    }