Forum Discussion
Oferb
Nimbostratus
Feb 09, 2017Irule with Dynamic Regexp
Hello,
I need help about Regexp.
The [HTTP::payload] at HTTP_REQUEST_DATA is dynamic. i made a procedure that build the regexp.
i don't know how to write the "if" Sentence.
The procedure:
se...
JRahm
Admin
Feb 10, 2017Clarity would be helpful. Once you provide clear guidance on what you are trying to accomplish, I'd recommend you also take a look at scan instead of regex. Just some pointers to give you additional ideas:
% set opts [list "\[10\]" "\[43,11\]" "\[55,65,999\]"]
{[10]} {[43,11]} {[55,65,999]}
% foreach pattern $opts {
set num [scan [string trim [string trim $pattern "\["] "\]"] %d,%d,%d x y z]
switch $num {
1 { puts Result: \n $x }
2 { puts "$x, $y" }
3 { puts "$x, $y, $z" }
}
}
Result:
10
43, 11
55, 65, 999
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
