Hi I need to get a string inside 2 pair of square brackets in javascript using regular expressions.
here is my string [[12]],23,asd
[[12]],23,asd
So far what I tr
If you need to get 12 you can just use what you mentioned with a capturing group \[\[(\d+)\]\]
\[\[(\d+)\]\]
var myRegexp= /\[\[(\d+)\]\]/; var myString='[[12]],23,asd'; var match = myRegexp.exec(myString); console.log(match[1]); // will have 12