Forum Discussion
Francois_LAGANT
Nimbostratus
Apr 05, 2013problem with string map and regex
Hello,
I have a problem of syntax to write the string map operation with regex.
I am trying to delete a parameter toto=[0-9]& ...
Kevin_Stewart
Employee
Apr 05, 2013Here 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