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
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…