Replace number by regex - Node.js Regular expression

Node.js examples for Regular expression:Replace

Description

Replace number by regex

Demo Code


Util.replaceNumber = function(original, number) {
  return original.replace(/[\d]+/, number);
};

Related Tutorials