Match at every second occurrence

Use grouping.

foo.*?(foo)

Leave a Comment