check for part of a string, read in all then split up
<p>so in different parts of text i will have random links that I need to read in an interpret.</p>

<p>for example the text might be </p>

<pre><code>&lt;div id="test"&gt;
&lt;li&gt; blah blah&lt;/li&gt; 
&lt;li&gt; &lt;!--{Byond:cta|localAction:products:4|Cool Dude}--&gt; blah blah blahs&lt;/li&gt; 
&lt;li&gt; blah facility blah**&lt;/li&gt; 
&lt;li&gt; No blah of blahpayment&lt;/li&gt; &lt;/ul&gt; 
&lt;p&gt; &lt;!--{Byond:cta|localAction:contact|Contact Us}--&gt;&lt;/p&gt; &lt;p&gt; &amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>so first of of all I know i can read it in</p>

<pre><code>var text = $("#test").html();
</code></pre>

<p>and then i could check for </p>

<pre><code>if (text.indexOf("Byond:cta|localAction") &gt;= 0) { 
    //do something
{
</code></pre>

<p>where i have //do something is where now I need to read in each instance of byond:cta|localAction - but i need to read it in from the start point which is <code>&lt;!--</code> until the end point which is <code>--&gt;</code> and i am not sure how to do this</p>

<p>I am guessing once i have that as a string i can use sting.split to take the data out i need..</p>
