I have a string that I want to extract text between comment tags, manipulate it, and replace it back. Here is what I am trying to work with:
...
<!--RegionStart url="http://domain1.com"-->
some text here
<!--RegionFinish-->
...
<!--RegionStart url="http://domain2.com"-->
some text there
<!--RegionFinish-->
...
<!--RegionStart url="http://domain3.com"-->
some text anywhere
<!--RegionFinish-->
...
I would like to get a collection of the text between the comment tags and enumerate thru them like this:
foreach (string item in collection)
{
string newText = item.Replace("some", "all") + Custom(url);
//put text back somehow
}
I am trying to end up with this:
...
<!--RegionStart url="http://domain1.com"-->
all text here domain1.com
<!--RegionFinish-->
...
<!--RegionStart url="http://domain2.com"-->
all text there domain2.com
<!--RegionFinish-->
...
<!--RegionStart url="http://domain3.com"-->
all text anywhere domain3.com
<!--RegionFinish-->
...
How can I do this?