Forum Discussion
John_Lennon_457
Nimbostratus
Dec 01, 2010Problem with regexp in HTTP class redirection
I'm following this solution http://support.f5.com/kb/en-us/solutions/public/7000/700/sol7771.html and I created a HTTP Class to redirect like this:
when URL matches:
(?i).*testxyz.* ...
hoolio
Cirrostratus
Dec 02, 2010Hi John,
I don't normally recommend regexes as they're a lot more expensive than string commands. However, it would take a lot of string commands to do this in one line. Can you try this?
http://[HTTP::host][regsub "find_this_string" [HTTP::uri] "replacement_string"]
http://www.tcl.tk/man/tcl8.4/TclCmd/regsub.htmM5
-all
All ranges in string that match exp are found and substitution is performed for each of these ranges. Without this switch only the first matching range is found and substituted. If -all is specified, then ``&'' and ``\n'' sequences are handled for each substitution using the information from the corresponding match.
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects