FindText URL parsing

T

Thierry

Hi,

I need to insert a hyperlink in every url appearing in my document.
For that, I am using the "Selection.Find" object. I would need to look
up for something like that:

<[a-zA-Z1-9.:?]{1,}.com>

for instance. But I cannot make it work. What is wrong? Obviously
something but I don't know what. In addition of that the period "." is
considered as word separator, is there a way to set which character
are word separator?

Any answers would be greatly appreciated

Thierry
 
K

Klaus Linke

Searching for URLs with wildcard expression <[a-zA-Z1-9.:?]{1,}.com>


Hi Thierry,

The problem is:
<[a-zA-Z1-9.:?]{1,} will already match any URL like www.microsoft.com.

{1,} will match as many of the preceeding expression as possible.

So since all the URL is already "gobbled up", the second part of the
expression ".com>" will never match anything.


I don't know the proper syntax for URLs, or if you want to limit your
matches in some way.

<www.[a-zA-Z1-9.:?]{1,}
might work for many URLs, though it matches trailing full stops.

Greetings,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top