When using the function replace option, the p1, p2, …, pN and group parameters don't work. I haven't tested all others, but I am able to use match.
A trivial example:
Replace: (the) (word)
With: p1 + 'test' + p2
fails to work and instead also prevents all subsequent replacements from working (presumably due to the script erroring).
However,
Replace: (the) (word)
With: match.replace(/(the) (sign)/gi, '$1 test $2')
works as expected, resulting in the test word.
If it's relevant, I'm on Firefox 121.0.
In addition to fixing this, I'd recommend adding a try-catch group around executing a replacement function so that if it errors for whatever reason it doesn't affect subsequent replacements.
When using the function replace option, the
p1, p2, …, pN
andgroup
parameters don't work. I haven't tested all others, but I am able to usematch
.A trivial example: Replace:
(the) (word)
With:p1 + 'test' + p2
fails to work and instead also prevents all subsequent replacements from working (presumably due to the script erroring).However, Replace:
(the) (word)
With:match.replace(/(the) (sign)/gi, '$1 test $2')
works as expected, resulting inthe test word
.If it's relevant, I'm on Firefox 121.0.
In addition to fixing this, I'd recommend adding a try-catch group around executing a replacement function so that if it errors for whatever reason it doesn't affect subsequent replacements.