Regex is not suitable for C #

I wrote a simple program to get information from the Internet

string loginName = null;
Regex rloginName = new Regex(@" <tr><td dir='rtl'><h1>(.*?)</h1><br /></td></tr> <!--.............. Titel der Referat ..............-->");

Match mloginName = rloginName.Match(source);
if (mloginName.Success)
{

}

      

ok I am testing this on RegexBuddy 3, everything is fine, but in my code, I can't get something too,

so where is my code problem

here is the code:

<tr><td dir='rtl'><h1>xxx:xxx:xxxx:xxx@xxx.xxx</h1><br /></td></tr> <!--.............. Titel der Referat ..............-->     
          <tr><td dir='rtl' style='text-align: justify'>

      

and I want to get

xxx:xxx:xxxx:xxx@xxx.xxx

      

0


a source to share


2 answers


It's a tiny space at the beginning of your Regex template. If you remove it, you can get what you want using mloginName.Groups [1].



+2


a source


So, are there any spaces / new lines in the webpage?



0


a source







All Articles