Merge pull request #622 from dmgk/master

Make extract_urls regex more portable
This commit is contained in:
Nikos Tsipinakis 2019-04-08 17:54:21 +03:00 committed by GitHub
commit 6cab789154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ static bool regex_init(void)
return true;
char *regex =
"\\b(https?://|ftps?://|news://|mailto:|file://|www\\.)"
"\\<(https?://|ftps?://|news://|mailto:|file://|www\\.)"
"[-[:alnum:]_\\@;/?:&=%$.+!*\x27,~#]*"
"(\\([-[:alnum:]_\\@;/?:&=%$.+!*\x27,~#]*\\)|[-[:alnum:]_\\@;/?:&=%$+*~])+";
int code = regcomp(&url_regex, regex, REG_EXTENDED | REG_ICASE);