Regex reg = new Regex( matchExpression ); MatchCollection matches = reg.Matches( value ); if ( matches.Count >= Nth occurrence ) { matches[n].Value); }
Originally posted as a Categorized Answer.
In reply to Re: How do I find the Nth occurrence of a pattern?
by Anonymous Monk
in thread How do I find the Nth occurrence of a pattern?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |