Javascript regex for validating url dating house bricks

6854933580_2c8b688306_z

I try to hold this modular, so it can be better maintained and adapted to own requirements.

javascript regex for validating url-19javascript regex for validating url-46javascript regex for validating url-50javascript regex for validating url-40
/^(?

:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )(?

:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )*(?

If you want pure regex then you can just take out the length check.

I think it's a good idea to test the length of the URL though if you really want to determine compliance with the spec. must be set to this var regex = new Reg Exp("^(http[s]?

Assume that this regex will be used for a public URL shortener written in PHP, so URLs like shouldn’t pass (even though they’re technically valid).

You must have an account to comment. Please register or login here!