PDA

View Full Version : help with Regular Expression


demo7up
12-04-2011, 08:19 PM
I need something like this ^([1-9]|[1-4][0-9]|50)$

but to only allow 6 chars but only numbers and letters thanks

LifesGreatestGift
12-04-2011, 09:09 PM
^([a-zA-Z0-9]{6})$

--------------- Added 1323036650 at 1323036650 ---------------

this might work, or get you going in the right direction. not the best at regex

--------------- Added 1323036760 at 1323036760 ---------------

would be easier if we knew what this was going to be used for.

you can test your expressions with
http://regexlib.com and the Regex tester link

nerbert
12-04-2011, 11:31 PM
<a href="https://vborg.vbsupport.ru/showthread.php?p=2257327&highlight=regular+expression+tester#post2257327" target="_blank">https://vborg.vbsupport.ru/showt...er#post2257327</a>

demo7up
12-04-2011, 11:56 PM
didnt work but thanks im trying to use the tester its for a custom field that i only want to allow 6 letters or number any combination just cant surpass 6 characters.

nerbert
12-05-2011, 01:21 AM
This seems to work

/\b[a-zA-Z0-9]{6}\b/

demo7up
12-05-2011, 01:54 AM
This seems to work

/\b[a-zA-Z0-9]{6}\b/


i get this error when i add that to the custom field and the text i am entering is "nycjdm" w/o the quotes

You did not enter the correct format for the License Plate Text field. Please read the field description for the expected format.

nerbert
12-05-2011, 02:13 AM
Well, what is the "field description for the expected format"?

demo7up
12-05-2011, 02:22 AM
Here is a screen shot

demo7up
12-05-2011, 02:22 AM
nvm i got it working thanks!!! u rock

LifesGreatestGift
12-05-2011, 07:02 PM
so what was the issue? what did you do to resolve it? what regex ended up working?

demo7up
12-05-2011, 07:15 PM
sorry I didnt post back how i resolved it. In the custom user profile field there is a setting
(Max length of allowed user input) that allows you to enter the max length.