![]() |
Help me to validate my RegEx code.
I want it to match all alphanumeric characters (digits and letters, uppercase and lowercase), spaces " ", underscores "_", dashes "-", and dots "." and it should be at least 3 characters long and not more than 32 characters long.
Would it be.. ^[A-Z0-9.-_]{3,32}+$ ^[A-Z0-9.-_]{3,32}$ ^[A-Za-z0-9.-_]{3,32}+$ ^[A-Za-z0-9\.\-_]{3,32}+$ Which one would be correct if any (I need it for vbulletin forms) ? Thank you in advance for the help. :helpme |
No one? I have thought this was webmaster board. :helpme
|
last bump
|
1+1 =2
---- |
E. none of the above
|
I think #4 is the closest. I don't think the minus sign is a metacharacter, so you don't need to escape it. I also don't think you need the plus sign before the dollar sign. Thus I end up with:
^[A-Za-z0-9\.-_]{3,32}$ Good luck :thumbsup |
I don't know what you are talking about.
|
Quote:
Of course it needs escaping :winkwink: ^[A-Za-z0-9\.\-_ ]{3,32}$ or shorter still ^[\w\.\-]{3,32}$ note with this though, \w as it's recognising word characters, will allow tabs and line breaks, not just white space.... if you don't want them, negate them: ^[\w\.\-^\t^\n]{3,32}$ |
Quote:
|
Quote:
|
All times are GMT -7. The time now is 07:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123