follow the url spec for url path characters

This commit is contained in:
Daniel Micay 2012-09-21 17:41:06 -04:00
parent fdd1ba0ce1
commit e3671e1d6f
1 changed files with 1 additions and 3 deletions

View File

@ -7,11 +7,9 @@
#define HOSTCHARS_CLASS "[-[:alnum:]]" #define HOSTCHARS_CLASS "[-[:alnum:]]"
#define HOST "(?:" HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*)?" #define HOST "(?:" HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*)?"
#define PORT "(?:\\:[[:digit:]]{1,5})?" #define PORT "(?:\\:[[:digit:]]{1,5})?"
#define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/~#%\\E]"
#define PATHTERM_CLASS "[^\\Q]'.}>) \t\r\n,\"\\E]"
#define SCHEME "(?:[[:alpha:]][+-.[:alnum:]]*:)" #define SCHEME "(?:[[:alpha:]][+-.[:alnum:]]*:)"
#define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?" #define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?"
#define URLPATH "(?:(/" PATHCHARS_CLASS "+(?:[(]" PATHCHARS_CLASS "*[)])*" PATHCHARS_CLASS "*)*" PATHTERM_CLASS ")?" #define URLPATH "(?:/[[:alnum:]$-_.+!*'(),;/?:@&=]*)"
const char * const url_regex = SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH; const char * const url_regex = SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH;