in reply to Count number of occurrences of a substr

Also notice the somewhat-obscure regex modifiers ("m," "i," and "g" seem to come to mind) that allow you to repeatedly match within a single string. The "position" where matching is to start (or resume) can be controlled precisely. It's somewhat obscure and therefore feels a bit like voodoo, but it's not.
  • Comment on Re: Count number of occurrences of a substr