vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Custom Field REGEX Help (https://vborg.vbsupport.ru/showthread.php?t=196896)

HypedGaming 11-21-2008 08:40 PM

Custom Field REGEX Help
 
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:
Code:

[^(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:
Code:

^[^(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:
Code:

hello
1 hello
123 hello
hello 123
1hello 23

but should disallow:
Code:

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

Quote:

Originally Posted by HypedGaming (Post 1670652)
It should match if, and only if, the entire field equals 1 or 123456.
[...]
but should disallow:
Code:

1
123456


Kind of contradicting there, no? ;)

HypedGaming 11-23-2008 10:02 PM

Quote:

Originally Posted by Dismounted (Post 1670992)
Kind of contradicting there, no? ;)

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


All times are GMT. The time now is 04:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01014 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete