Merge pull request #377 from RichardHitt/issue376

Parse url according to rfc 1738: add separate define for TLD.  Closes 376.
This commit is contained in:
TingPing 2013-01-16 14:06:50 -08:00
commit 8b451edf9c
1 changed files with 3 additions and 2 deletions

View File

@ -347,9 +347,10 @@ do_an_re(const char *word,int *start, int *end, int *type)
}
/* Miscellaneous description --- */
#define DOMAIN "[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+"
#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 "|" IPADDR ")"
#define HOST "(" DOMAIN TLD "|" IPADDR ")"
#define OPT_PORT "(:[1-9][0-9]{0,4})?"
GRegex *