1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[fgX] Advanced Censoring [Paid] 1.1.1

Powerful post censoring using regular expressions.

  1. farang

    farang Well-Known Member

    farang submitted a new resource:

    [fgX] Advanced Censoring - Censoring posts using regular expressions. Helps prevent spam.

    Read more about this resource...
  2. Mouth

    Mouth Well-Known Member

    Would be great to see some example configurations.
    farang likes this.
  3. farang

    farang Well-Known Member

    hi @Mouth

    There are some samples provided in the plugin to help You get started. All of them are inactive (commented out) except one.

    # Below are some sample pattern matching expressions.
    # Lines  preceded with a # sign are comments.
    # Remove mantra-like post text that ends with 2 line breaks followed by some
    # text that ends with 'alk'
    # Matching something like 'Sent from my D96-Phone using a cornstalk'
    "/\n{2}s.+alk$/i", ""
    # Replace all e-mail addresses with  the text  '[E-mail removed]'
    # (At this stage they are already BB-encoded)
    # "/\[EMAIL(.+?)\[\/EMAIL\]/i", "[E-mail removed]"
    # Replace all URLs to "somesite.com" with  the text  '[URL removed]'
    # "/\[URL(.+?)somesite\.com(.+?)\[\/URL\]/i", "[URL removed]"
    Another example:

    # Match viagra, viaaggggra, via gra, via.gra, \/|AGRA, \/I/\GR/\, v1aqra, vi@gr@ and variants
    "/[v\\]+\/?.?[i:1!\|]+.?[a@\/]+\\?.?[gq]+.?r+.?[a@\/]+\\?/i", "[Medicin]"
    The example above is quite powerful since it can catch a lot of common alternative spellings of a word. Using the standard built in censoring would require hundreds of entries (probably thousands) to do the same thing. :D
  4. Mouth

    Mouth Well-Known Member

    Is there a regex generator or checker somewhere (site?) that you could suggest I can build and test regex expressions that I would likely use?
  5. farang

    farang Well-Known Member

    What we use is PCRE regular expressions. There are a few checker sites out there. I prefer https://regex101.com/
    But don't use the "g" modifier in your defined search patterns. It's implicit with preg_replace()

  6. farang

    farang Well-Known Member

Share This Page