better url recognition, less mismatches
This commit is contained in:
parent
23e2a8094e
commit
c711606640
2
menu.c
2
menu.c
@ -27,7 +27,7 @@ char *extract_urls(const char *to_match)
|
|||||||
|
|
||||||
if (!is_initialized) {
|
if (!is_initialized) {
|
||||||
char *regex =
|
char *regex =
|
||||||
"((http|ftp|https)(://))?(www\\.)?[[:alnum:]_-]+\\.[^[:space:]]+";
|
"((http|ftp|https)(://))?(www\\.)?[[:alnum:]_-]+\\.[^[:space:]\"<>]{2,}";
|
||||||
int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE);
|
int ret = regcomp(&cregex, regex, REG_EXTENDED | REG_ICASE);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
printf("failed to compile regex\n");
|
printf("failed to compile regex\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user