Page 1 of 1

Regular expression for word filter

Posted: Fri Oct 04, 2019 10:32 pm
by Lsha
is there anyway we can use regular expression for word filter

Re: Regular expression for word filter

Posted: Sat Oct 05, 2019 2:19 am
by Exclusive
Do you mean word censoring?

Re: Regular expression for word filter

Posted: Sat Oct 05, 2019 6:55 am
by Lsha
yes, word censoring

Re: Regular expression for word filter

Posted: Sat Oct 05, 2019 12:31 pm
by i6eal
I would do it like so:

create an array with all the bad words ["fuck","shit", ...], create a funktion to run after the post/comment is created and iterate through the bad words array and censor all the bad words with i.E. ******.

Re: Regular expression for word filter

Posted: Sat Oct 05, 2019 7:18 pm
by canonknipser
That function is builtin with phpBB and is called "word censoring", working when any part of a word contains a censored word.

I guess the OP wants something working with regular expressions, which will be beyond the scope of a regular phpBB admin :oops:

Re: Regular expression for word filter

Posted: Sat Oct 05, 2019 7:21 pm
by Lsha
@canonknipser

thanks for the confirmation