私はHTML内の[0]のすべてのインスタンスを置き換えたいと思いますが、現在使用している正規表現は[0]だけでなくすべての0を置き換えます。ここで私が持っているものです。Javascript Regex replace 0 [0]でなく0
var clone = clone.html().replace(/[0]/g, total); // Total is a number that increments
私が代わるものの例は、何かのようである:
<input id="Items[0].Id" name="Items[0].Id" value="0" type="text" />
しかし、Javascriptの上記=「0」の値に0を置き換え、任意のアイデアはどこで落下していますを通して?
http://stackoverflow.com/questions/928072/whats-the-regular-expression-that-matches-a-square-bracket –