Forum Discussion
Francois_LAGANT
Nimbostratus
Apr 05, 2013problem with string map and regex
Hello,
url: http://1.1.1.1/index.php?param=1&toto=5&tata=no
I want the following result:: http://1.1.1.1/index.php?param=1&tata=no
When i use this :
1 Reply
- Kevin_Stewart
Employee
Here are two methods:
Method 1 (string map):
set uri [string tolower [HTTP::uri]]
set totonum [findstr $uri "toto=" 5 "&"]
set test "set newuri \[string map \{toto=$totonum& \"\"\} $uri\]"
eval $test
log local0. "newuri1: $newuri"
Method 2 (regsub):
if { [regsub -nocase "toto=\[0-9\]&" $uri "" newuri2] } {
log local0. "newuri2: $newuri2"
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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