in reply to How do I find the Nth occurrence of a pattern?

C#
Regex reg = new Regex( matchExpression ); MatchCollection matches = reg.Matches( value ); if ( matches.Count >= Nth occurrence ) { matches[n].Value); }

Originally posted as a Categorized Answer.