The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Regex for an empty field
I've created a custom field for registration only and it is supposed to be left blank.
I'd like to use the regex field to test that the field is still blank and use the internal vB checking and error reporting system to reject the registration if the user has entered anything at all in the field. Regex seems to be great for testing patterns, and the inclusion of characters. How do I get it to test for the emptiness? |
#2
|
||||
|
||||
Don't bother with regex, just trim the field and see if the result is an empty string
$field = trim($field) if ($field != '') ... |
#3
|
||||
|
||||
thanks, but I got it going.
I'm trying to keep it simple and not use plugins or hacks - just stick to the core of vB. vB allows us to check the value of the field using regex, so it makes sense to utilise that functionality. I have no problem with using plugins where that's the only way but when there is a built in alternative ... |
#4
|
||||
|
||||
Code:
.+ |
#5
|
||||
|
||||
actually, it turned out to be
Code:
^$ |
#6
|
||||
|
||||
Whoops, you are correct. I thought you meant you wanted not to allow a blank field. Sorry.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|