Certain regular expressions may cause the script to run quite slowly such as my bad example of /(.\W?)*/i.
This regular expression and others like it may match lines and lines of text instead of just a short word or phrase. What could be done instead is to use the rule /./i, make the "replacing text phrase" unique such as "delete all", and add a conditional that changes the matched text to something else that isn't "delete all". I'll add a console message on the run time of the script for reference if you'd like to see how long it takes to run.
Slow Regular Expressions
Certain regular expressions may cause the script to run quite slowly such as my bad example of /(.\W?)*/i. This regular expression and others like it may match lines and lines of text instead of just a short word or phrase. What could be done instead is to use the rule /./i, make the "replacing text phrase" unique such as "delete all", and add a conditional that changes the matched text to something else that isn't "delete all". I'll add a console message on the run time of the script for reference if you'd like to see how long it takes to run.