Background: I'm trying to generate a list of references from a page that has references throughout, and replace the reference markup with HTML.
I'm working in C#
Text looks something like:
The dog ate 3 cats and felt ill <ref name="something">http://cateater.com</ref>
I'd like to use the Regex.Replace method to replace all the <ref>
s, pushing them into a Hash that I can later render as a list of references.
Problem: it looks like the way to run code during the replace operation is to use a 'MatchEvaluator Delegate' that takes in a Match object, but doesn't seem like it can take other parameters.
The example on MSDN uses a class variable to accomplish this, but I'm hoping there is a more elegant solution.