If you are adding usefull regex functions at the end of the code, you could also add information on replace function taking a callback as an argument.
const p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';
p.replace('dog', (match, matchIndex, originalString) =>{
return match+"test"+matchIndex // match based replacer
})
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you are adding usefull regex functions at the end of the code, you could also add information on replace function taking a callback as an argument.
const p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';
p.replace('dog', (match, matchIndex, originalString) =>{
return match+"test"+matchIndex // match based replacer
})