In AS3:

Actionscript:
  1. ...
  2. var regExpDigitString:String = "\\d+"
  3. modified = original.replace(new RegExp(regExpDigitString, "gi"), findSuffix);
  4. ...
  5.  
  6. private function findSuffix():String {       
  7.     var result:String = arguments[0];
  8.     var index:int = arguments[1];
  9.     var input:String = arguments[2];
  10.        
  11.     ...
  12.                
  13.     return result;
  14. }

In C#

C#:
  1. ...
  2. String regExpDigitString = "\\d+";        
  3. modified = Regex.Replace(original, regExpDigitString, new MatchEvaluator(findSuffix), RegexOptions.IgnoreCase);
  4. ...
  5.  
  6. private String findSuffix(Match m) {
  7.     String result = m.ToString();
  8.     int index = m.Index;
  9.     String input = original; //apparently you can't get the original string out of the Mach Object, so you'll need a reference to the original Object in your class.       
  10.            
  11.        ...   
  12.  
  13.     return result;
  14. }