Recently, I came across a code challenge to find the number of occurrences of a character in a string.
It was intended to use it as a validator in order to perform some minimum char length along with the occurrences.
Anyhow, it took some time to figure out a way using Regex.
1 | searchString |
Tip: Try to modify the Regex to match only a set of chars occurrences.