I have a rather complicated requirement to find dynamic text within a document and replace it with calculated data. There is no finite list of what I am trying to replace, so I ma having to use regular expressions to locate the correct text. I need to know if there is a way to iterate through the document in order to insure that I can replace all of the instances of text. Here is an example of text that needs replacing:
There are [CARS:Total] cars on the lot. Of these [CARS:Blue] are blue cars and [CARS:Red] are red cars.
Will the following code work (assuming I have my regular expression correct)?
System.Text.RegularExpressions.Match expressionMatch = regex.Match(word.Range.Text);
Thanks in advance.