[mew-int 2932] Re: Identify urls

"Diogo F. S. Ramos" <[email protected]> Fri, 05 Nov 2010 13:07:30 -0200 (BRST)
Newsgroups gmane.mail.mew.general
Message-ID <[email protected]>
>> Well, I slightly modified the regex used by Mew to identify urls. In
>> my brief experience it seems to recognize correctly a little bigger
>> set of urls than the previous one.
> 
> I am not sure allowing closing braces inside URLs is the way to go.
> Sure some URLs contain braces but these are usually balanced.  I
> personally use the following regex to allow "depth 1" matching braces.
> 
> (setq mew-regex-url
>   (let ((u "[^ 	\n>()\"]*"))
>     (concat "\\b\\(\\(\\(file\\|news\\|mailto\\):\\)"
> 	    "\\|\\(\\(s?https?\\|ftp\\|gopher\\|telnet\\|wais\\)://\\)\\)"
> 	    "\\(" u "\\|(" u ")\\)*[^ 	\n>.,:)\"]+")))

You have a valid point, although I don't see the disadvantage of
allowing closing braces inside URLs, but I guess it should correctly
identify URLs like `(http://www.example.com/foo(bar))baz' as
`http://www.example.com/foo(bar)'.

Unfortunately I tried your solution with `re-builder' but it always
stop recognizing the URL at a closing parentheses. Could you verify if
it is working there for you?

-- 
Diogo F. S. Ramos