LOG IN SIGN UP
Documentation

regsuball()

Replaces all occurrences of pattern, which may be a Perl-compatible regular expression, in input with replacement. If no matches are found, no replacements are made.

Once a replacement is made, substitutions continue from the end of the replaced buffer. Therefore, regsuball("aa", "a", "aa") will return a string "aaaa" instead of recursing indefinitely.

This function may fail to make a replacement if the regular expression recurses too heavily. Such a situation may occur with lookahead and lookbehind assertions, or other recursing non-regular expressions. In this case, fastly.error is set to "EREGRECUR".

This function is not prefixed with the std. namespace.

Format

STRING
regsuball(STRING input, STRING pattern, STRING replacement)

Examples

1
set req.url = regsuball(req.url, "\+", "%2520");