how to replace regular expression in js code example
Example: replace regex javascript
const p = 'lazy dog. If the dog reacted, was it really lazy?';
const regex = /Dog/ig;
p.replace(regex, 'ferret')
// output: lazy ferret. If the ferret reacted, was it really lazy?