Regex Match Example

                Never    
C#
       
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RegexMatch.Properties;
using System.Text.RegularExpressions;

namespace RegexMatch
{
    class Program
    {   
        public static void Main(string[] args)
        {
            // regex example
            String pattern = "\\S*((<){1}\\s?(script|noscript)\\s{0,2}(type=\"text/script\")?\\s?(>){1}(\\W[A-Za-z0-9]*)*(</script>|</noscript>))";
            Regex regex = new Regex(@pattern, RegexOptions.IgnoreCase);
            String content = Resources.html;

            Match match = regex.Match(@content);

            if (!match.Success)
                Console.WriteLine("Match value: 0");
            else
                Console.WriteLine("Match value: {0}", match.Value);

            Console.ReadKey();
        }


    }
}

Raw Text