jquery - javascript url regex -


I use a regex in JavaScript to enter both subdomain and domain names without users http: // prefix How can I give permission? I need to allow: domainname.com or www.domainname.com or www.domainname.co.uk. At this time I hope to www. :

  / ^ (? = Www.) [A-Za-z0-9 _-] + \. [E-za-j0-9 \ /% & Amp; = \? _: -] + $ / ix.test (value);    

Try it out:

  / ^ (? = Www.)? [E-za-j 0-9 _-] + \. [E-za-j0-9 \ /% & Amp; = \? _ :; -] + $ /  <
 

A ? Marking the www group with makes it a zero or a match, which is what I understand.



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -