160
rated 0 times
[
163]
[
3]
/ answers: 1 / hits: 110398
/ 15 Years ago, tue, september 29, 2009, 12:00:00
I need to return just the text contained within square brackets in a string. I have the following regex, but this also returns the square brackets:
var matched = mystring.match(\[.*]);
A string will only ever contain one set of square brackets, e.g.:
Some text with [some important info]
I want matched to contain 'some important info', rather than the '[some important info]' I currently get.
More From » regex