I didn't see index or rindex anywhere in your code (another way to find and/or count strings inside other strings.)
Also, it seems to me that 'x' should be prepended and appended to all the strings.
In reply to Re: Speed of simple pattern count. A comparison
by jwkrahn
in thread Speed of simple pattern count. A comparison
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |