2

I use jquery validator for url & it return true for this url:

http://www.abc...com

I'm not sure if it is a valid url?

Sparky
  • 98,165
  • 25
  • 199
  • 285
QuanNH
  • 319
  • 1
  • 6
  • 22

2 Answers2

5

Yes A url with many dots is valid. However a domain name with multiple consecutive dots is not valid since the length of each label has to be more than 0.

See:
https://lists.isc.org/pipermail/bind-users/2011-January/082725.html

To be conversant with URL semantics, you would need to read:

Which characters make a URL invalid?

In short there could be as many dots in the domain name section. However there should be at least a label of 1 to 63 characters between these dots. Refer to:

http://en.m.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax

Community
  • 1
  • 1
Khanna111
  • 3,627
  • 1
  • 23
  • 25
  • how is component separated if there are many dots (in case of my example) – QuanNH Nov 26 '14 at 06:24
  • A.b.c.d is a valid domain name. Here A, b, c, d are all labels that I referred to as components. For eg. Mail.yahoo.com is valid. The rightmost label is the top level domain ".com". Note I am assuming that the confusion is about the multiple dots in the domain name section of the URL – Khanna111 Nov 26 '14 at 06:26
  • Ahh. I understand your question. This is not valid since the length of a label should be between 1 and 63. https://lists.isc.org/pipermail/bind-users/2011-January/082725.html – Khanna111 Nov 26 '14 at 07:02
  • so basically, an url contains 2 dots (..) is not valid because the label is empty? – QuanNH Nov 26 '14 at 07:07
  • Yes. The example in the question is invalid. – Khanna111 Nov 26 '14 at 07:20
0

It seems like it is valid.

See this description of allowed characters in Unreserved Section:

https://www.rfc-editor.org/rfc/rfc3986#section-2.3

2.3. Unreserved Characters

Characters that are allowed in a URI but do not have a reserved
purpose are called unreserved.  These include uppercase and lowercase
letters, decimal digits, hyphen, period, underscore, and tilde.

unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
Community
  • 1
  • 1
mim
  • 477
  • 1
  • 3
  • 13