Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
T
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string s='jmano'; //https://visualstudiogallery.msdn.microsoft.com/16b9d664-d88c-460e-84a5-700ab40ba452 var regex = new System.Text.RegularExpressions.Regex("<td([^>]*)class='1'[^>]*>(\"+s+\".*?)</td>*"); var m = regex.Match("<table><tr><td class='1' style=''>manoj</td></tr><tr><td class='2' style=''>a</td></tr><tr><td class='3' style=''>n</td></tr></table><table><tr><td class='1' style=''>jmano</td></tr><tr><td class='2' style=''>a</td></tr><tr><td class='3' style=''>n</td></tr></table>"); Console.WriteLine(m.Groups[2].Value); Console.WriteLine ("Grp0: {0}",m.Groups[0].Value); Console.WriteLine ("Grp1: {0}",m.Groups[1].Value); Console.WriteLine ("Grp2: {0}",m.Groups[2].Value); Console.WriteLine ("Grp3: {0}",m.Groups[3].Value); Console.WriteLine ("Grp4: {0}",m.Groups[4].Value); } } }
run
|
edit
|
history
|
help
0
Конструктор классов + static
asxasx sxa
Read XML nodes into Data Dictionary
Convert string to TimeSpan in C#
Dan's Dice
gfrsdfdfvgh
property_comparison3
<script>alert(document.cookie)</script>
edszfcfsefer
CommandForce2