[Solved] Javascript replacing characters using replace() [duplicate]
Refer to the link in the comment I posted above to learn about regular expressions. But to explain to you what the code you posted actually does… var re = /(\w+)\s(\w+)/; is a regular expression. the leading and trailing / are delimiters and don’t actually have anything to do with the replacement going on other … Read more