iPurpl3x Thanks for checking the extension out π
iPurpl3x I have made slight change to your email regex to match more cases and it doesn't do anything:
\b[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]+\b/mig
iPurpl3x And I have this other one, meant to hide phone numbers and it does not work either:
(\b(([0-9]{4})|0|1)|\B+[1-9]{1,3})(\s?(0))?(\s)?[1-9]{2}(\s)?[0-9]{3}(\s)?[0-9]{2}(\s)?[0-9]{2}\b/mig
Couple of things here. Firstly, you need to make sure that the regex begins with /
, and also you don't need the g
for global either. By modifying your examples to the examples below, I was able to test them successfully.
/\b[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]+\b/mi
/(\b(([0-9]{4})|0|1)|\B\+[1-9]{1,3})(\s?\(0\))?(\s)?[1-9]{2}(\s)?[0-9]{3}(\s)?[0-9]{2}(\s)?[0-9]{2}\b/mi
iPurpl3x Last thing: when I tested the one that worked, I also activated the Flag option. This gave me a Permission Denied 403 error when trying to make a post. Once I disabled the Flag option it worked fine.
This is interesting, potentially the user who posted the matched content does not have flag permissions, would that be correct? I might need to revisit how the flag is raised in this case