Forum Discussion
emiliocb4_27077
Nimbostratus
May 11, 2011scan problem
hi all,
follow is a part of my irule
set valore "*gtw1"
scan $valore %s%s primo secondo
log local0.debug " primo= $primo secondo= $secondo"
set valore1 "* gtw1"...
hoolio
Cirrostratus
May 11, 2011Hi Emilio,
The problem is that everything but a space (or other whitespace) will be matched with %s:
http://www.tcl.tk/man/tcl8.4/TclCmd/scan.htmM12
So you'd need to be able to specify a character class that doesn't include the in order to use scan for the first string. If you just want to split the string on a specific character you can use getfield or split instead:
http://devcentral.f5.com/wiki/default.aspx/iRules/getfield
http://www.tcl.tk/man/tcl8.4/TclCmd/split.htm
If neither of those options work, can you give more detail on what you're trying to parse? The more examples, the better.
Aaron
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