[mew-int 2932] Re: Identify urls
Diogo F. S. Ramos
diogofsr at example.com
Sat Nov 6 00:07:30 JST 2010
>> 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
More information about the Mew-int
mailing list