On Mar 29, 2006, at 1:44 PM, John Gold wrote:
Is there a grep pattern to format email addresses and web site
addresses? Or does BBEdit have a built in tool to search and replace
for these? I tried creating a text factory file, but there was no
setting to format these links.
What do you mean by "format"?
Ronald
By formatting, I mean a script that will find instances of:
[trimmed]
Just because it starts in 'www' or ends in '.com' doesn't
mean it's a reference to an HTTP server.
What you're asking for as actually two things:
1. find things that are getting turned into hyperlinks
2. turn the things into hyperlinks
The second one is easy, when you know what the proper protocol
and such:
<a href='mailto:\1'>\1</a>
or:
<a href='http://\1'>\1</a>
or:
<a href='\1'>\1</a>
-- but the first one is a royal pain.
Want a regex to match email addresses?
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
Yes, that is 6k for the regex. I have no idea how BBEdit will
handle it, as it's intended for Perl.
I'm not even going to attempt a regex to match valid URIs.
I'd probably instead use something that's intended to generate
HTML from plain text, like Markdown:
http://daringfireball.net/projects/markdown/
-----
Joe Hourcle
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>