[PATCH] Added support for matching IPv6 addresses, fixed URL parsing, and adding some characters for email address parsing.

Liviu Andronic landronimirc at gmail.com
Tue Jul 23 08:25:56 CEST 2013


Dear Jeff,
Best would be to place the patch on Bugzilla. Developers are more
likely to review them there.

Regards,
Liviu


On Tue, Jul 23, 2013 at 6:39 AM, Jeff Shipley <jshipley at fastmail.fm> wrote:
> From: Jeff Shipley <jshipley at fastmail.fm>
>
> ---
>  terminal/terminal-widget.c |   12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
> index d490994..5a7d266 100644
> --- a/terminal/terminal-widget.c
> +++ b/terminal/terminal-widget.c
> @@ -40,17 +40,19 @@
>
>
>
> -#define USERCHARS       "-_+[:alnum:]"
> +#define USERCHARS       "-[:alnum:]\\Q_.+\\E"
>  #define USERCHARS_CLASS "[" USERCHARS "]"
>  #define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]"
>  #define HOSTCHARS_CLASS "[-[:alnum:]]"
> -#define HOST            HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*"
> +#define HOSTNAME        HOSTCHARS_CLASS "+(?:\\." HOSTCHARS_CLASS "+)*"
> +#define IPV6ADDRESS
> "\\[(?:[[:xdigit:]]{0,4}:){2,7}[[:xdigit:]]{0,4}\\]"
> +#define HOST            "(?:" HOSTNAME "|" IPV6ADDRESS ")"
>  #define PORT            "(?:\\:[[:digit:]]{1,5})?"
>  #define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/:~#'%\\E]"
> -#define PATHTERM_CLASS  "[^\\Q]'.}>) \t\r\n,\"\\E]"
> +#define PATHTERM_CLASS  "[[:alnum:]\\Q_$+*@&=/~#%\\E]"
>  #define SCHEME
>  "(?:news:|telnet:|nntp:|file:\\/|https?:|ftps?:|sftp:|webcal:|magnet:)"
>  #define USERPASS        USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?"
> -#define URLPATH
> "(?:(/"PATHCHARS_CLASS"+(?:[(]"PATHCHARS_CLASS"*[)])*"PATHCHARS_CLASS"*)*"PATHTERM_CLASS")?"
> +#define URLPATH         "(?:(?:\\(" PATHCHARS_CLASS "*\\)|"
> PATHCHARS_CLASS ")*(?:\\(" PATHCHARS_CLASS "*\\)|" PATHTERM_CLASS "))?"
>
>
>
> @@ -78,7 +80,7 @@ TerminalRegexPattern;
>  static const TerminalRegexPattern regex_patterns[] =
>  {
>    { SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH,
>    PATTERN_TYPE_FULL_HTTP },
> -  { "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH,
> PATTERN_TYPE_HTTP },
> +  { "(?:www[[:digit:]]{0,3}|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT
> URLPATH, PATTERN_TYPE_HTTP },
>    { "(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@"
>    HOSTCHARS_CLASS "+\\." HOST, PATTERN_TYPE_EMAIL },
>    { "news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+",
>    PATTERN_TYPE_FULL_HTTP }
>  };
>
> --
> http://www.fastmail.fm - One of many happy users:
>   http://www.fastmail.fm/help/overview_quotes.html
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


More information about the Xfce4-dev mailing list