Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fórum ➡ Finding STRONG tags that contain UL tags, using Regex class♦
//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; // aljodav // http://rextester.com/users/376 // in reply to the thread // https://social.msdn.microsoft.com/Forums/WindowsServer/en-us/ecf63c6b-cbb0-4f3c-8025-2c525082c486/regular-expression-question-what-is-the-regular-expression-for-my-search?forum=csharpgeneral namespace Rextester { public class Program { public static void Main(string[] args) { // SINGLE LINE STRINGS ONLY! string test="<p>red green <strong>blue</strong> cyan <strong><ul><li>Sun</li><li>Mercury</li></ul></strong> magenta <strong>yellow</strong> orange <strong><ul><li>Venus</li><li>Earth</li></ul></strong>"; string patt1="<strong.+?/strong>"; string patt2="<ul.+?/ul>"; // NOTICE ➡ it is QUITE SIMPLE! foreach(Match m in Regex.Matches(test,patt1)){ Console.WriteLine( Regex.Match(m.Value,patt2).Success?m.Value:"" ); } Console.WriteLine("\n\nHello, world! :P"); } } }
run
|
edit
|
history
|
help
0
Exemplu OOP inventar
String to keycode and switch check
tester of xpath
First Test With Coder - 3 digit number into digits
AAAXACAdxcd
Task 1_4
Lesson1_1_Part2.cs
LINQ
linear search
Demonstration await Control returned to the Caller