This is the string that I am trying to manipulate using Regex in c#.
string hyperlinkPattern = "For more information go to Hello Click here "
I am trying to get the output in following format -
So, I should first get the value of "id", "number" and "alt" tag from the "myHyperlink" tag and then use these value while replacing that tag with "
The input value is in string format even though it looks like html value.
I am trying to do this using regular expression and not able to proceed with getting the pattern. Any help or clue would be highly appreciated.
thank you
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 24, 2012, 3:18 PM
using System;
using System.Text.RegularExpressions;
class Test
{
static void Main()
{
string hyperlinkPattern = "For more information go to
string regFind = "
string regReplace = "";
hyperlinkPattern = Regex.Replace(hyperlinkPattern, regFind, regReplace);
Console.WriteLine(hyperlinkPattern);
Console.ReadKey();
}
}
The output should be:
For more information go to
Deer ParkPosted Sep 24, 2012, 5:17 PM