Recognize urls without www component.

For more complex regexp, another library might be required.
This commit is contained in:
Fabien Freling 2014-12-07 23:14:24 +01:00
parent adcb83ac8f
commit 229932ece4

View file

@ -2,7 +2,7 @@ open Str
let is_url url =
let regexp = regexp "\\(https?\\://\\)?www\\..+\\..+" in
let regexp = regexp "\\(https?\\://\\)?\\(www\\.\\)?.+\\..+" in
string_match regexp url 0