Javascript Regular Expression To Remove Trailing Numbers In Parenthesis
How can I replace/append something (22) string to something, using some kind of expression matching something is not a constant its always different but the part (integer) is alway
Solution 1:
Here it is:
var text = "Java (77) Javascript (22) Car (11) Carpet (15)";
text.replace(/(\w+) \(\d+\)/g,"$1"); // returns "Java Javascript Car Carpet"
Post a Comment for "Javascript Regular Expression To Remove Trailing Numbers In Parenthesis"