PDA

View Full Version : Custom Field REGEX Help


HypedGaming
11-21-2008, 08:40 PM
I've noticed some bots always use certain things in the custom fields so I thought I would try to disallow those certain strings in the custom fields, but I can't really get it to work.

I've been trying:

[^(123456)]


It needs to match anything that is:

NOT 1, OR NOT 123456
OR AN EMPTY STRING


That code will work for the first requirement, but not for the second. I have the field set the not required, so I don't know why it's even checking when it's empty. I'm not sure if this is a bug (or feature :P) of vBulletin, but I was hoping if someone could help me with the regular expression to match said requirements.

Using vBulletin 3.6.*

Dismounted
11-22-2008, 05:13 AM
Try this:
^[^(123456)]*$

HypedGaming
11-22-2008, 03:08 PM
That sorta works, except it doesn't allow their input if a number is anywhere in the field - and it's a field some people might input numbers into. It should match if, and only if, the entire field equals 1 or 123456.

it should allow:

hello
1 hello
123 hello
hello 123
1hello 23


but should disallow:

1
123456


or if someone could just point me in towards a plugin that is effective at stopping bots from registering that would be great too

Dismounted
11-23-2008, 02:40 AM
It should match if, and only if, the entire field equals 1 or 123456.
[...]
but should disallow:

1
123456

Kind of contradicting there, no? ;)

HypedGaming
11-23-2008, 10:02 PM
Kind of contradicting there, no? ;)

It should match if, and only if, the entire field does not equal 1 or 123456 *