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!
JG
Cumulonimbus
Sep 11, 2017
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"
}
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