Skip to content

Instantly share code, notes, and snippets.

@derjabkin
Created March 15, 2013 14:59
Show Gist options
  • Save derjabkin/5170451 to your computer and use it in GitHub Desktop.
Save derjabkin/5170451 to your computer and use it in GitHub Desktop.
Regex Replace with sequential numbers
string s = @"aasdas %.*ls dasdasdasd %.*ls asdaasddas %ls";
int i = 0;
s = Regex.Replace(s, @"%(\.\*){0,1}ls", (m) => "%" + (++i).ToString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment