Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple line matching using Regex
    primarykey
    data
    text
    <p>I have this string stream:</p> <pre><code>"do=whoposted&amp;amp;t=1934067" rel=nofollow&gt;61&lt;/A&gt;&lt;/TD&gt;&lt;TD class=alt2 align=middle&gt;5,286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD id=td_threadstatusicon_1911046 class=alt1&gt;&lt;IMG id=thread_statusicon_1911046 border=0 alt="" src="http://url.com/forum/images/statusicon/thread_new.gif"&gt; &lt;/TD&gt;&lt;TD class=alt2&gt;&lt;IMG title=Node border=0 alt=Node src="http://url.com/forum/images/icons/new.png"&gt;&lt;/TD&gt;&lt;TD id=td_threadtitle_1911046 class=alt1 title="http://lulzimg.com/i14/7bd11b.jpg &amp;#10; &amp;#10;Complete name : cool-thread...."&gt;&lt;DIV&gt;&lt;A id=thread_gotonew_1911046 href="http://url.com/forum/f80/cool-topic-new/"&gt;&lt;IMG class=inlineimg title="Go to first new post" border=0 alt="Go to first new post" src="http://url.com/forum/images/buttons/firstnew.gif"&gt;&lt;/A&gt; [MULTI] &lt;A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/"&gt;Cool Topic Name&lt;/A&gt; &lt;/DIV&gt;&lt;DIV class=smallfont&gt;&lt;SPAN style="CURSOR: pointer" onclick="window.open('http://url.com/forum/members/u2031889/', '_self')"&gt;m3no&lt;/SPAN&gt; &lt;/DIV&gt;&lt;/TD&gt;&lt;TD class=alt2 title="Replies: 11, Views: 1,554"&gt;&lt;DIV style="TEXT-ALIGN: right; WHITE-SPACE: nowrap" class=smallfont&gt;Today &lt;SPAN class=time&gt;08:04 AM&lt;/SPAN&gt;&lt;BR&gt;by &lt;A href="http://url.com/forum/members/u1131830/" rel=nofollow&gt;karetsos&lt;/A&gt; &lt;A " </code></pre> <p>The lines I am interested are similar to this:</p> <pre><code>&lt;A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/"&gt;Cool Topic Name&lt;/A&gt; </code></pre> <p>From here all I am trying to extract are:</p> <pre><code>Thread id: 1911046 (could be from either location in the string) Thread name: "Cool Topic Name" Thread link: "http://url.com/forum/f80/cool-topic-name-1911046/" </code></pre> <p>Currently I use this:</p> <pre><code>Regex pattern = new Regex ( "&lt;A\\s+href=\"([^\"]*)\"&gt;([^\\x00]*?)\\s+id=thread_title_(\\S+)&lt;/A&gt;" ); MatchCollection matches = pattern.Matches ( doc.ToString ( ) ); foreach ( Match match in matches ) { int id = Convert.ToInt32 ( match.Groups [ 1 ].Value ); string name = match.Groups [ 3 ].Value; string link = match.Groups [ 2 ].Value; ... } </code></pre> <p>I would appreciate if someone can help me fix the pattern to match it. This used to work but it returns 0 matches.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload