Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
javascript regular expression, valid domain format
Old 03-28-2006, 07:57 PM javascript regular expression, valid domain format
Unknown.

Posts: 1,693
Trades: 0
I need to be able to check that the domain entered into a field is in the valid format of a domain, which I'm sure can be done using a regular expression, but its not exactly something I've ever understood!

If someone could help me out on this that would be great, thanks!
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-30-2006, 12:49 AM Re: javascript regular expression, valid domain format
lizard dude's Avatar
Super Talker

Posts: 119
Location: France
Trades: 0
I think you need to use the indexOf jscript.
__________________
forum------->
Please login or register to view this content. Registration is FREE
, for people who wants to have a good time ;)
website------>
Please login or register to view this content. Registration is FREE
(might be in construction :D)
Hope you have a great time and that my post is helpfull ;)
lizard dude is offline
Reply With Quote
View Public Profile
 
Old 03-30-2006, 04:18 AM Re: javascript regular expression, valid domain format
Super Talker

Posts: 144
Trades: 0
well, u can do it but there are many versions of a url.

you got for instance:

www.blah.com
www.something.us
subdomain.crap.yahoo.co.uk

and that's just to name a few.

also, remember that you can have numbers and underscores and hyphens in that sequence of characters as well. you can also have an IP point to a domain.

it would be simple to catch www.my_domain-is-no1.com ... we could even catch diff extensions like us and com together...

/www\.[a-z0-9_\-]+\.[a-z]{2, 3}/ig.test(string)

but the rest.. well, i suppose if you new EVERY form of the URI possible, we could go from there
__________________
create.vibe

Please login or register to view this content. Registration is FREE
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Reply     « Reply to javascript regular expression, valid domain format
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11238 seconds with 12 queries