Re: The URL regex.
- From: Gediminas Paulauskas <menesis delfi lt>
- To: Brian Stafford <brian stafford uklinux net>
- Cc: Albrecht =?iso-8859-13?Q?Dre=DF?= <albrecht dress arcormail de>,Pawel Salek <pawsa TheoChem kth se>, Carlos Morgado <chbm chbm nu>,balsa-list gnome org
- Subject: Re: The URL regex.
- Date: Tue, 22 May 2001 12:33:33 +0200
Hello.
I have looked into GtkHTML, it uses four regexps to recognize even URLs,
with omitted protocol part.
static HTMLMagicInsertMatch mim [] = {
{ "(news|telnet|nttp|file|http|ftp|https)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-a-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, NULL },
{ "www[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "http://" },
{ "ftp[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "ftp://" },
{ "[-_a-z0-9.]+@[-_a-z0-9.]+", NULL, "mailto:" }
};
The first part of structure is the URL, second -- the NULL, the last one is
protocol prefix.
So in Evolution I think all URLs are highlighted correctly.
--
Gediminas Paulauskas --- ICQ 24859336
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]