Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to select and highlight many sentences in which Microsoft Word in which the start word and the end word of the sentence/phrase is the same, but the content in between is different.

How can I achieve this using the find function in word? I want to automate doing this as it should be possible, only thing is I don't know how to achieve this. It would take a very long time for me to manually highlight so many phrases

share|improve this question
up vote 2 down vote accepted

Try using regular expressions.

Microsoft has a tutorial here:

share|improve this answer
this i already know off but could you write the exact expression? – rzlines Apr 17 '11 at 17:50
Let me try and figure it out. I don't quite have word available on the PC. It may be something along the lines of (<*>)*\1 in their custom syntax which is not the standard I'm good with – Vlueboy Apr 17 '11 at 18:18
the worry is that all the characters that i'm trying to find are special characters so I'll need to escape them too I guess – rzlines Apr 17 '11 at 18:24
I tested with my string above, but can't limit to once per line. Special chars can be input or escaped. Multi-highlight searches appear to be impossible without VBA macros like this apparent solution. Either paste the code into a real shell outside Word with real regular expressions (cygwin's bash is useful but huge), or you'll need VBA. Sorry that I couldn't solve the issue. – Vlueboy Apr 17 '11 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .