RegEx Replacement Loop Q.

I learned from Kem how to use a do loop when searching my matches for RegEx patterns. I need to basically do this with regex replace. I have a pattern I am matching and replacing, but it stops after the first match. I know I need to loop, but I can’t quite get the syntax correct yet.

This is my code that matches and replaces the first pattern.
Source String to Parse

  Dim RemoveExtraChars_RegEx as RegEx
  Dim RemoveExtraChars_RegExMatch as RegExMatch
  Dim RemoveExtraChars_RegEx_HitText as String
  RemoveExtraChars_RegEx = New RegEx
  RemoveExtraChars_RegEx.options.caseSensitive = False
  RemoveExtraChars_RegEx.Options.Greedy= False
  RemoveExtraChars_RegEx.Options.ReplaceAllMatches = False
  RemoveExtraChars_RegEx.Options.TreatTargetAsOneLine = True
  RemoveExtraChars_RegEx.SearchPattern = "\\d[:]|(?<=[,]).*[:]"
  RemoveExtraChars_RegEx.ReplacementPattern = ""
  Dim RemoveExtraCharResult as String = RemoveExtraChars_RegEx.Replace(Trim_JSON_String)

// Need some Do Loop to continue Match/Replacing

Thank you once again for the help All!

Wow talk about a Brain fart.

RemoveExtraChars_RegEx.Options.ReplaceAllMatches = False

Umm Let me flip this to True and you … never saw this :slight_smile: :slight_smile: