GBurch
Jun 28, 2019Altostratus
Syntax for iRule string manipulation
I have an iRule with the following code:
set schema [getfield [HTTP::uri] "&" 2]
set host [getfield [HTTP::uri] "&" 3]
set uri [getfield [HTTP::uri] "&" 4]
which works in the vast majority of cases. However, in cases where the URI itself contains an ampersand character, the string is truncated.
Is there an alternative I could replace the 3rd line with which would return everything after the 3rd ampersand character in a string? I could do it quite easily on other languages, but can't quite get my head around the syntax for TCL!
Many thanks