views:

53

answers:

0

Possible Duplicate:
jQuery find/replace without changing original text

I have the following RegEx but I am getting a JS error

RegEx:

$("#construct_version").html(
   new RegExp("(" + selection + ")", "g"),
   $("$1").wrap(childElements[child]));

JS Error: Uncaught Syntax error, unrecognized expression: $1

This questions references this other question: jQuery find/replace without changing original text