regex - javascript regular expression to remove trailing numbers in parenthesis -
How do I some (22)
string to some
I can change it, it is not always used to use any type of expression that is in any form, but the part (integer) is always the same. Cheers
Edit
I think this is a little confusing (even for me) Here is what I mean. I have a string - a word in which alpha expression (a word, any word) is to open a single space and inside the paranthesis and the interior, I now change the spaces, paranithesis and integer with nothing to change And just want to leave the alpha part of the string.
Ex:
java (77) javascript (22) car (11) carpet (15)
after Regex Look like this:
java javascript car carpet
Note that each word is rejeked individually, I have written some examples So that things can be more clear in reading and understanding. Thanks
Here it is:
var text = "Java ( 77) Javascript (22) car (11) carpet (15) "; Text.replace (/ (\ w +) \ (\ d + \) / g, "$ 1"); // Returns the returns of "java javascript car carpet"
Comments
Post a Comment