For this prototype url checker. Note all I'm trying to do is get the length checked at this point.
url: /:\/\/(www\.)?.{1,200}\..{1,1800}/,
Jslint.com is giving error
Insecure '.'
I had a similar error with this negated character set on this SO post.
Given that backgroud, I think it is obvious jslint does not like allowing all or mostly all as a test pattern.
So, I simply need to replace the . with a valid character set for domains and the part after the domain.
For the domain I can simplify to
[a-zA-Z0-9\-]
What is the character set for the part after the domain...i.e.after foo.com/
So there is
//
followed by
www.(optional)
followed by
foo.boo.moo.(note it matched up until the last .) ( this character set is listed above)
followed by
X
how do I lump all of X together:
http://www.foo.X
I'm not concerned with extracting ports or query information, I just need the character set for everything after the domain, to make the regex "secure" per jslint.
Note, I'm just trying to improve incrementally.
JavaScript, The Good Parts has a good URL checker on the regex chapter, but not what I need right now.