Forum Discussion
David_Noonan_67
Nimbostratus
Oct 08, 2007Syntax for "matches" and "matches_regex"
We've got an iRule that contains the following code. It works fine but I find the repetition offensive.
elseif {[HTTP::uri] contains "fx1"} {
use pool Xyzzy
}
elseif {[HTTP::uri]...
Deb_Allen_18
Oct 09, 2007Historic F5 Account
Braces may be used to prevent interpretation of strings surrounded by [] as commands, as you experienced ("undefined procedure").
As long as there isn't a variable inside the braces that requires expansion, you can use them in most cases instead of "", and they can actually be more efficient, if harder to type & read.
Colin wrote an excellent tech tip recently about using {} with numbers to prevent the tcl interpreter from having to figure out if they are strings or not before performing the operation: http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=110 (Click here)
(Someday I'm going to have to go re-work all of my codeshare examples to take advantage of that optimization...)
HTH
/deb
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