, JS . , .
, , re.exec() "string".match(re) -. Exec, , , , , , ( /g ).
, exec, , ? = , match . ? =
re = /((.+)(?:.*?\2)+)/g
"XXinputinputYY".match(re);
["XX", "inputinput", "YY"]
re.exec("XXinputinputYY");
["XX", "XX", "X"]
, , inputinput . , , , , .
, firebug, , $1, , , - $vars .