I have the String "Edit[user]", but I need get "Edit" and later "user".
How can I do it? Any help would be useful.
Of course I need do it with JavaScript regex.
What you are looking for is grouping. I'll quickly explain how these work in JavaScript and leave the actual Regular Expression up to you.
var myString = "cat dog frog";
var myRegexp = /(cat).*(frog)/g;
var match = myRegexp.exec(myString);
match will be an array, index 0 will have the whole match, and any others will have the contents of the groups.
match[0] = "cat dog frog"
match[1] = "cat"
match[2] = "frog"
\b?