CEO and founder of Lingohub. Envisioning a multilingual digital world. Email me if you have questions about how Lingohub can help you take your products global.

Helmut Development 0 Comments

Dev Bit: How to reuse matched value of regex in JavaScript’s replace() function

We all know the replace() function for JavaScript Strings and that it is possible to do really fancy things by using regular expressions to replace a (sub)string. What I didn’t know was that there are special $ references you can use in the replace() function. Of course there is $1, $2,.. to get the first, second finding, BUT did you …