How to perform a .substring() on a string from .match() in Javascript?
<p>Not working code:</p>

<pre><code>var m;
val = "some text with a [tag: in it like that";
m = val.match(/\[\w+:/);
var params = m.substring(1).split(':');
</code></pre>

<p>Throws the following error in Firebug:</p>

<p><code>val.substring is not a function</code></p>

<p>When I do <code>console.log(typeof(val));</code> I get object, when I'm expecting a string... at least, I think it should be a string.</p>

<p><strong>How can I perform a .substring() on a "string" from .match() in Javascript?</strong></p>
