Finding domain names in word document

G

Guest

I'd like to be able to extract all the instances of .co.uk domain names from
a word document. The way I would have done it is using a wildcard in words
find and replace function, for example: *.co.uk however, this selects all the
text in the document. Specifically, I'd like to search for domain names that
start there own paragraph, So I would have thought the formula would be
something like "^p*.co.uk" but this doesnt seem to work. If anyone could help
with this I would be very grateful as this will save me hours. Thanks.
 
H

Herb Tyson [MVP]

When wildcards are used, you need to use ^13 instead of ^p i the Find field.
But, that's not the problem in this case. I suspect that the urls are
hyperlinks, and that the field delimiters are introducing a wrinkle or
two... but at the same time, if they're hyperlinks, this provides a
different plan of attack.

Are these URLs hyperlinks? If so, and if all of the URLs in the document are
..co.uk, then an easy solution is simply to search for the Hyperlink style,
leaving the Find what: field blank, and Use Wildcard can be turned off.

If you do need to include .co.uk to identify them, but they are formatted as
hyperlinks, then use the following:

Find what:*.co.uk
Use Wildcards
Style:Hyperlink

If they aren't hyperlinks, do the URLs all begin with http? If so, then
http*.co.uk (Use Wildcards checked) might get you what you want (although,
there's a chance that it could get you a lot more). You'd want to use a
number of occurrences wildcard to prevent the search from including too much
between "http" and ".co.uk" (which might mean multiple URLs in the same
"find"), such as http?{1,20}.co.uk.
 
G

Guest

Thanks for the help Herb, you saved me a lot of effort. I was able to get
what I wanted using "^13*.co.uk" and a tiny bit of editing.
 

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