Forum Discussion
____177053
Cirrus
Sep 11, 2017How to count a letter in a string by irules?
We wants to count how many "a" or something else in a string using irules,How can we do that?
Thanks a lot!
1 Reply
- JG
Cumulonimbus
when CLIENT_ACCEPTED { set NEEDLE "a" set HAYSTACK "ababab" set NUMBER [llength [regexp -all -inline (?=$NEEDLE) $HAYSTACK]] log local0. "Number of instances of a found: $NUMBER" }
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