The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I am trying to figure out how to code the regular expression as a valid expression for:
0123-4567-8901 I only want to accept '0123456789' and the '-' characters. Here is the regular expression code vBAdminCP links to: http://us3.php.net/manual/en/function.preg-match.php But, I am a bit confused how to control this expression for a mix of numbers and the dash character with the above bolded format. All ideas welcome. ![]() |
#2
|
||||
|
||||
![]() Code:
^[0-9]{4}-[0-9]{4}-[0-9]{4}$ |
#3
|
|||
|
|||
![]()
That helps a lot!
![]() Thank you! ![]() |
#4
|
||||
|
||||
![]()
There's probably a simplified way of doing it, but I just simply don't know. (I [s]hate[/s]dislike regex.
![]() |
#5
|
||||
|
||||
![]()
I would use:
Code:
^[0-9]{4}-[0-9]{4}-[0-9]{4}$|^$ |
#6
|
|||
|
|||
![]()
I added the extra code.
![]() Thank you for the tip. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|