Announcement

Collapse
No announcement yet.

Help with regular expression

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • tommykjensen
    replied
    Thanks that worked.

    Leave a comment:


  • Dody
    replied
    Oh, I though you were doing your own mod/hack.
    anyway, wouldn't be something like this:
    PHP Code:
    ^[^"Text1"

    Leave a comment:


  • tommykjensen
    replied
    I do not know how vbulletin interprets the code it is a field in admincp under userprofile fields.

    Leave a comment:


  • Dody
    replied
    What I wrote above is not a php code, it is a common data modelling notion.
    are you using preg_match?

    Leave a comment:


  • tommykjensen
    replied
    Thanks regex because thats what vbulletin needs in that field in user profiles.

    But the expression do not work.

    Not even this works which is the most important part. The 5 word requirement I could be without.

    Code:
    /(^[^$text1]) (^[^$text2])/

    Leave a comment:


  • Dody
    replied
    Why regex while you can do it the other way?

    PHP Code:
    $exploded_inputtext explode(' '$input);
    if( 
    $input != $text1 && $input != @text2 && sizeof($exploded_inputtext) > 4) { //do what ever you want here } 
    or you can also do it the regex way

    Code:
     
    /(^[^$text1]) (^[^$text2])(+[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ [^ ]+)/
    good luck
    Last edited by Dody; Mon 20th Jul '09, 2:06am.

    Leave a comment:


  • tommykjensen
    started a topic Help with regular expression

    Help with regular expression

    To prevent spambots from registering I have added an extra required profile question. It is a free form text field which contents I manually verify and based on the content accept or delete the new member.

    Currently I have no regular expression added for the field which means that anything in the field lets the spambot save the registration.

    What I have determined is that the bots always puts the same into the field and I have so far seen 2 different texts.

    So now I want to add an expression that accomplish following:

    - must not be text1
    - must not be text2
    - must contain at least 5 different words

    Can someone help me with this ?

Related Topics

Collapse

Working...
X