Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-21-2010, 10:55 AM   #1
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
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.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 04:18 PM   #2
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
No one? I have thought this was webmaster board.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 08:20 PM   #3
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
last bump
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 08:30 PM   #4
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
1+1 =2

----
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 08:50 PM   #5
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
E. none of the above
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 09:01 PM   #6
anicetan
Registered User
 
anicetan's Avatar
 
Join Date: Mar 2003
Posts: 73
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
__________________

High Quality - Low Prices

Last edited by anicetan; 01-21-2010 at 09:03 PM..
anicetan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-21-2010, 09:03 PM   #7
fatfoo
ICQ:649699063
 
Industry Role:
Join Date: Mar 2003
Posts: 27,763
I don't know what you are talking about.
__________________
Send me an email: [email protected]
fatfoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-22-2010, 12:40 AM   #8
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Quote:
Originally Posted by anicetan View Post
I don't think the minus sign is a metacharacter, so you don't need to escape it.

^[A-Za-z0-9\.-_]{3,32}$

Good luck
If the minus sign isn't a metacharacter, then what is it doing in eg A-Z and a-z and 0-9???

Of course it needs escaping

^[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}$
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-22-2010, 01:11 AM   #9
StaceyJo
Confirmed User
 
StaceyJo's Avatar
 
Join Date: Mar 2008
Posts: 8,960
Quote:
Originally Posted by borked View Post
If the minus sign isn't a metacharacter, then what is it doing in eg A-Z and a-z and 0-9???

Of course it needs escaping

^[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}$
Good info. Thanks,
__________________
/_______ WebCashMaker ______\
| _TeenageDecadence - Young Board Naked Teens. |
| ____ NonNudeGirls - Female Puberty Photos. ____ |
| _ HerSelfPics - The ORIGINAL exGF SelfPic site. __ |
\.______ xPosing - Wife Photosharing site. _______./
StaceyJo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-22-2010, 06:38 PM   #10
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
Quote:
Originally Posted by borked View Post
If the minus sign isn't a metacharacter, then what is it doing in eg A-Z and a-z and 0-9???

Of course it needs escaping

^[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}$
Thank you! You restore my faith in webmater occurrence on this board.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.