![]() |
Regular Epression for Profile Fields Discussion
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. :cool: |
Code:
^[0-9]{4}-[0-9]{4}-[0-9]{4}$ |
That helps a lot! :cool:
Thank you! :cool: |
There's probably a simplified way of doing it, but I just simply don't know. (I [s]hate[/s]dislike regex. :p)
|
I would use:
Code:
^[0-9]{4}-[0-9]{4}-[0-9]{4}$|^$ |
I added the extra code. :cool:
Thank you for the tip. :cool: |
All times are GMT. The time now is 03:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|