I need a regex that will match a certain string and replace each letter of it with a symbol.
So... "Cheese"
would be replaced by "******"
but "Pie"
would be replaced by "***"
So for example:
"my pie is tasty and so is cake".replace(new RegExp(/(pizza|cake|pie|test|horseshoe)/gi), "'*' x length($1)")
(Obviously the substitution doesn't exist)