Phil_Dindak
Mar 28, 2018Nimbostratus
Regex alternative suggestion for string replacement
I have a couple of regexes that work just fine.
log local0. "original [HTTP::uri]"
if { [HTTP::uri] matches_regex {/lpportal-\d+/?} } {
regsub -- {/lpportal-\d+/?} [HTTP::uri] $portal p1
HTTP::uri $p1
log local0. "replaced [HTTP::uri]"
}
The regexes mean: /lpportal-\d+/? = look for “/lpportal-“ followed by at least one or more digits (\d+) and possibly a trailing “/” (/?)
However, I read here that regexes are one of the most expensive calls to make on the BIG-IP LTM. Look for alternative that is not so cpu expensive.
Thanks in advance!
Phil