使用分组。我添加了一个
?使之匹配的“ ungreedy”,因为这可能就是您想要的。
var matches = mystring.match(/[(.*?)]/);if (matches) { var submatch = matches[1];}
使用分组。我添加了一个
?使之匹配的“ ungreedy”,因为这可能就是您想要的。
var matches = mystring.match(/[(.*?)]/);if (matches) { var submatch = matches[1];}