Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A bit of manual parsing is probably the fastest way to solve this. Regex would be possible, too, because it's really just a very simple case of parsing a link and not a whole HTML document, but that could easily choke on those large files, performance wise.</p> <p>Now, let me preface this that I haven't tested this at all and I feel kinda dirty posting it (I'm sure it needs some more edge-case checks to avoid errors), but here you go:</p> <pre><code> const char[] quotes = new char[] { '"', '\'' }; private List&lt;string&gt; ExtractLinks(string html) { var links = new List&lt;string&gt;(); string searchFor = "&gt;Fixed_String&lt;/a&gt;"; for (int i = html.IndexOf(searchFor); i &gt;= 0; i = html.IndexOf(searchFor, i + searchFor.Length)) { string href = ExtractHref(html, i); if (!String.IsNullOrEmpty(href)) links.Add(href); } return links; } private string ExtractHref(string html, int backtrackFrom) { int hrefStart = -1; // Find "&lt;a", but limit search so we don't backtrack forever for (int i = backtrackFrom; i &gt; backtrackFrom - 255; i--) { if (i &lt; 0) return null; if (html[i] == '&lt;' &amp;&amp; html[i + 1] == 'a') { hrefStart = html.IndexOf("href=", i); break; } } if (hrefStart &lt; 0) return null; int start = html.IndexOfAny(quotes, hrefStart); if (start &lt; 0) return null; int end = html.IndexOfAny(quotes, start + 1); if (end &lt; 0) return null; return html.Substring(start + 1, end - start - 1); } </code></pre> <p><code>XmlReader</code> is probably a no-go, because you most likely cannot guarantee that those files are XHTML formatted. If you want to do proper parsing, the <a href="http://htmlagilitypack.codeplex.com/" rel="nofollow">HTML Agility Pack</a> is probably your best choice, or maybe a properly done Regex if it can't be helped. I posted this manual parsing so you have another alternative you can do a performance test with.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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