using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^([a-z0-9_-]+)(\.[a-z0-9_-]+)?@([a-z0-9_-]+)\.([a-z0-9]{2,})$";
string input = @"<header class=""noSelect"">
<div id=""HIAccueil"" class=""I-B"">
<img class=""pointer"" src=""IMG/BACKGROUND/HEADER/logoban.png"" alt=""Accueil"" onclick=""clickMenu(tousLesMenus, 2, tousLesMenus[0].nom, 1, 0, 0, 0, tousLesMenus[1].url);"">
</div>
<div id=""HIPC"">
<div id=""HIProfile"" class=""I-B"">
<!-- vide pour img via js -->
</div>
<div id=""HIConnect"" class=""I-B"">
<img class=""pointer"" src=""IMG/BACKGROUND/HEADER/connect_hover.gif"" alt=""Connect"" onclick=""clickMenu(tousLesMenus, 5, tousLesMenus[0].nom, 4, 1, 1, 0, tousLesMenus[4].url);"">
</div>
</div>
</header>
Tralloc_Nivek-02.baza_R-d421@gmail45.com
Tralloc_Nivek-02@gmail45.com
Tralloc_Nivek-02.baza_R-d421gmail45.c
010/226679
010226679
010/22.66.79
010/22 66 79
0470040747
0470/040747
0470/040.747
0470/04.07.47
0470/04 07 47
0470/040 747
+0032470040747
0032470/040 747
+00320470040747";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx