Replace the URLs entered in a textarea with "url_removed" I am using Drupal 8.9.1 and Webform module 8.5.16. I looking for the best way to either replace all URLs that a user might enter in a text area with &quot;url_removed&quot; or not allow the user to enter a functioning URL.
The goal is to prevent webform submission emails from having potentially malicious links within them the body of a comment.
When adding your text area to the webform you can set form validation and use a regex that makes sure the text is free of urls.  Something like:
/^(?!.(http|www|ftp|file|data|irc)).$/gmi
You definitely want to revise the actual regex as Im sure this one is not all inclusive.  I'm far from a regex expert.