I need to explain a little: I want to find how many "abab" exists in "ababab" string.
But skipping is valid like
[abab]ab
[aba]ba[b]
[ab]ab[ab]
[a]ba[bab]
these are all valid, my attempt was to use < /\w*?a\w*?b\w*?a\w*?b/g > which of course did not work. What should I do?
Python solutions are also good for me, I thought regex would be good for this.
Edit: Marked similar question is quite different to my question