diff options
author | Diogo Sousa <diogogsousa@gmail.com> | 2013-06-16 02:57:38 +0100 |
---|---|---|
committer | Diogo Sousa <diogogsousa@gmail.com> | 2013-06-16 04:22:28 +0100 |
commit | 6bc05a8bc835d38e7e245bb70ee748809f5277b2 (patch) | |
tree | 83030e95d1ec12d1ed8aaad4a866c6faaad9839b /src | |
parent | 7ef8d0d4438c8780dfe6db53add4bdc23118732a (diff) |
Improved host matching in url:
* Refined ipv4 addr * Added ipv6 addr
Diffstat (limited to 'src')
-rw-r--r-- | src/common/url.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/url.c b/src/common/url.c index 6c429ed8..84c112d1 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -349,8 +349,9 @@ do_an_re(const char *word,int *start, int *end, int *type) /* Miscellaneous description --- */ #define DOMAIN "[a-z0-9][-a-z0-9]*(\\.[-a-z0-9]+)*\\." #define TLD "[a-z][-a-z0-9]*[a-z]" -#define IPADDR "[0-9]+(\\.[0-9]+){3}" -#define HOST "(" DOMAIN TLD "|" IPADDR ")" +#define IPADDR "[0-9]{1,3}(\\.[0-9]{1,3}){3}" +#define IPV6ADDR "([0-9a-f]{0,4}(:[0-9a-f]{0,4})*:){2}[0-9a-f]{0,4}(:[0-9a-f]{0,4})*" +#define HOST "(" DOMAIN TLD "|" IPADDR "|" IPV6ADDR ")" #define OPT_PORT "(:[1-9][0-9]{0,4})?" GRegex * |