why doesn't this match RRS feed

  • Question

  • I have a thread here

    but this is a new question ... 

    So here it goes


     MatchCollection collection = Regex.Matches(strDocumentText, "<<<[a-zA-Z0-9]>>>");

     here is strDocumentText vairable  the string is html ( I put it in code block because then you can see more clearly)

    <META name=GENERATOR content="MSHTML 8.00.7600.16891"></HEAD>
    <P>Dear <SPAN>&lt;&lt;&lt;Description&gt;&gt;&gt;</SPAN></P><!-- IM TRYING TO MATCH THIS -->

    Look at my comment , how will i match &lt;&lt;&lt;Description&gt;&gt;&gt; between the <SPAN> tags in regex

    NOTE THAT THE (Description) will always change

    So anything like &lt;&lt;&lt;[ANYTEXTBETWEEN]&gt;&gt;&gt;

    should be a match in the matchcollection.

    Thanks for any suggestions

    Sunday, November 13, 2011 9:36 AM


All replies

  • This &lt;&lt;&lt;\w+&gt;&gt;&gt; is working for me.
    A.m.a.L Hashim
    Microsoft Most Valuable Professional
    Dot Net Goodies
    • Marked as answer by Magic Mushroom Sunday, November 13, 2011 10:15 AM
    Sunday, November 13, 2011 10:01 AM
  • > how will i match &lt;&lt;&lt;Description&gt;&gt;&gt; between the <SPAN> tags in regex
    using System.Text.RegularExpressions;
    var re = new Regex(
        RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled);
    var m = re.Match(html);
        var data = m.Groups["data"].Value;

    • Edited by Malobukv Sunday, November 13, 2011 10:03 AM
    Sunday, November 13, 2011 10:03 AM