A piece of Javascript code is as follows:
num=\"11222333\"; re = /(\\d+)(\\d{3})/; re.test(num); num.replace(re, \"$1,$2\");
It is known that in Javascript, the name of variables should begin with letter or _,
No, it's not. $1 is a perfectly valid variable. You have to assign to it first though:
$1
$variable = "this is a test"
This is how jQuery users a variable called $ as an alias for the jQuery object.
$
jQuery