On Dec 22, 2007 1:50 AM, Harold Fuchs <[EMAIL PROTECTED]> wrote:
> <snip>
>
> But now I realize that it may be possible to use find & replace to
> > find the next character that is EITHER a paragraph delimiter OR a
> > space. What regular expression would I use for this?
> >
> > To cut to the chase here, what I'm trying to do is create a macro that
> > will find each URL in turn in a Write document, and change it into a
> > hyperlink. My idea is to first find http:// and then either a space or
> > a paragraph delimiter. Then enter a space. This, when done manually,
> > turns a URL into a hyperlink.
> >
> > Thanks,
> >
> > Dick
> >
>
> The Regular Expression (RE) I used was ". *$" without the quotes. That's dot
> space asterisk dollar. This finds "any character" (the dot), followed by
> zero or more (the asterisk) spaces (the space) followed by the end of the
> line (the dollar). If you want "one or more" use a plus sign instead of the
> asterisk.

Please tell me more exactly what you did. My interpretation is that in
the Find & Replace dialogue box you put "$" (no quotes) in the Search
For textbox, and ". *$" (no quotes) in the Replace With textbox
(Regular Expressions checked). I'm using 2.3 on XP Pro, and this finds
the next paragraph delimiter, but replaces it with (literally) ". *$"
(no quotes), and also deletes the paragraph delimiter.

I've tested a simple macro that mimics a single pressing of the space
bar. I find that placing the cursor at the end of a URL and running
this macro does NOT convert the URL into a hyperlink.

> But this mechanical replacement process does *not* seem to turn the text
> into a hyperlink - this in my OO 2.2 on Win XP Pro. If you find it does
> work, please let us know which version of OO and which version of which OS
> you are using.

At this point I have a somewhat useful macro (and a key binding) that
finds the next http://, then the next $, then deselects the $, and
stops. Because 80% of the URLs are at the ends of lines, the cursor
will now be at the end of a URL. Pressing the space bar turns that URL
into a hyperlink. If I could find a regexp that would find EITHER a
space or a $, then I could easily make that macro much more
satisfactory. However, I'd still be a long way from a macro that would
convert ALL well-formed URLs into hyperlinks with the pressing of one
shortcut key combination.

Dick Moores
Bellevue, Washington, USA

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to