I have a few hundred static HTML files that need to be processed.
They contain links like this
<a href="http://www.mysite.com/">Link</a>
I need to add ?ref=self to any url that begins with http://www.mysite.com
and becomes
<a href="http://www.mysite.com/?ref=self">Link</a>
however, I do not know whether it's going to be http://www.mysite.com
or http://www.mysite.com/
also it could be linked to a sub directory.
What's the most efficient way to do this? in C#