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

XF 1.3 Spam Management - Regular Expression - No URLs In Posts

Discussion in 'XenForo Questions and Support' started by ProCom, Apr 9, 2014.

  1. ProCom

    ProCom Active Member

    I was thinking I'd like to limit links in the first few posts from new members using "Spam Phrases", specifically: "www" and "http".

    I thought maybe I couldn't just put them in like that and I'd need to use wildcards and maybe even the regular expression... but have questions:
    1. What is the best way to use spam phrases to moderate first posts with links?
    2. What are some examples of regular expressions and how are they used in spam phrases? (the example "/test/i" isn't too clear to me)
    Thanks!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    1) Just enter those strings directly, one per line as in the instructions. You don't need a regex if you are matching exact strings.

    2) If you want to match "bikes" and "bike" you could use a regex to make the "s" optional:

    /bikes?/i

    It's a dumb example, but it's late and my brain is sleepy.

    Regex has logic to match patterns and perhaps consolidate multiple words into one pattern.
     
  3. ProCom

    ProCom Active Member

    Thanks Jake!

    So, to clarify: I can just put in www and http and it will catch urls posted without doing any wildcards (*) or anything?

    Will it catch the ones that are embedded, like this: test
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes and yes.
     
    ProCom likes this.
  5. ProCom

    ProCom Active Member

    Rock on, thanks Jake!!!
     

Share This Page