I'm trying to match a Number in between a set of straight brackets, example:
Match the 0 in actionFields[actionFields][0][data[Report][action]]
This is what I have so far and I keep getting null.
var match, matchRegEx = /^\(?\[(\d)\]\)$/;
nameAttr = "actionFields[actionFields][0][data[Report][action]]",
match = matchRegEx.exec(nameAttr);
\(,\)) but there are none in your string. Why do you have them there? Also, your expression is anchored at the beginning and end, so only strings such as([5])or[3])would be matched.