我怎样才能只得到里面的文字Material[amhere]
?
例如,从...
PROD_RULE0001:WARNING: Metric[amhere] exceeded the UPPER WARNING limit[80.0]
...我只想要amhere
.
我试过了:
var strg = "WARNING: Material[amhere] exceeded the UPPER WARNING limit[80.0]";
var testRE = strg.match("Material\[(.*)\]");
alert(testRE[1]);