Javascript combining a reg expression and string
<p>I have a string which contains a nonvariable part, a variable numnber and another nonvariable part. I want to user <code>replace()</code>, to change only the variable part into a value a user chooses.
I'm a noob at javascript, and even a bigger noob in reg expressions, so sorry if this is something trivial.</p>

<p>Anyway, i have a string like this:</p>

<pre><code>"first nonvar part: "+any_integer+"last nonvar part".
</code></pre>

<p>i'd like to use regexp to replace any_integer. </p>

<p>Can i somehow combine string and regular expression matching to match the string by it's non variably parts with an unknown number in between?</p>

<p>So i can use:</p>

<pre><code>replace("first nonvar part: "+any_number+"last nonvar part","first nonvar part: "+user_input+"last nonvar part")
</code></pre>

<p>or something similar.</p>

<p>Many thanks</p>
