Is there a way to specify a regular expression to match every 2nd occurrence of a pattern in a string?
Examples
- searching for a against string abcdabcd should find one occurrence at position 5
- searching for ab against string abcdabcd should find one occurrence at position 5
- searching for dab against string abcdabcd should find no occurrences
- searching for a against string aaaa should find two occurrences at positions 2 and 4