declare local var.input STRING;
set var.input = "/foo
log "syslog " + req.service_id + " loggerName :: " +
"Replace multiple
var.input + " => " +
regsuball(var.input, "/+", "/");
set var.input = "www.example.com";
log "syslog " + req.service_id + " loggerName :: " +
"Remove leading www. from host header: " +
var.input + " => " +
regsub(var.input, "^www\.","");
set var.input = "/foo/bar/";
log "syslog " + req.service_id + " loggerName :: " +
"Remove trailing slash: " +
var.input + " => " +
regsub(var.input, "/$","");
set var.input = "/products/furbles/12345/photos";
log "syslog " + req.service_id + " loggerName :: " +
"Map path parameters: " +
var.input + " => " +
regsub(var.input, "^/products/(\w+)/(\d+)(/(\w+))?$","/legacy.cgi?cat=\1&id=\2&page=\4");
error 601;