# complex word search in MS-Word

**URL:** https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850
**Category:** Factual Questions
**Created:** [January 27, 2005, 1:17am UTC](https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850 "2005-01-27T01:17:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_Morris](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/peter_morris/32/359_2.png) [@Peter\_Morris](https://boards.straightdope.com/u/Peter_Morris)
#### Post date: [January 27, 2005, 1:17am UTC](https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850/1 "2005-01-27T01:17:45Z")

</div>

brief version : How do I find a word immediately followed by a carriage return?

more detailred version:

I have a text file in the following format:

a single word then a colon then a list of words like this

> [@](#):
>
> abandon:abandonment,abjection,abjure,abort,deep-six,degeneracy,desert,desist  
> abbreviation:abridgment,abstract,apocope,aposiopesis,astriction,astringency,blue-penciling  
> abdicate:abandon,abjure,cashier,cast,cease,cede,demit,drop,forgo,forswear,jettison,leave,quit,reject,relinquish,renounce,resign  
> abeyance:abandonment,abjuration,abjurement,apathy,break,caesura,catalepsy,catatonia,cease-fire,cessation,deadliness  
> abandoned:cast-off,castaway,ceded,committed,contaminated,corrupt

What I want to do is find any word containing one or more hyphen.

The search string \*\*[,:][a-z]@-\*, \*\* almost works. It finds **deep-six** and **cast-off** fine.

However if a hyphenated word comes at the end of a line, it will wrap around to the first comma on the next line. In the above example it will highlight **blue-penciling  
abdicate:abandon,**

How do I modify my search string so that it stops at carriage return?  
note : I thought that the Manual Line Break character would work, but it didn’t.

The End Of Word character fails on multi hyphenated words like **dyed-in-the-wool**. It only highlights **dyed-in.**

---

<div class="post-metadata">

### Author: ![galt](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@galt](https://boards.straightdope.com/u/galt)
#### Post date: [January 27, 2005, 2:00am UTC](https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850/2 "2005-01-27T02:00:40Z")

</div>

Try “^p”. Word treats a manual carraige return as a “paragraph mark”

---

<div class="post-metadata">

### Author: ![Peter\_Morris](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/peter_morris/32/359_2.png) [@Peter\_Morris](https://boards.straightdope.com/u/Peter_Morris)
#### Post date: [January 27, 2005, 2:17am UTC](https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850/3 "2005-01-27T02:17:06Z")

</div>

Sadly, it doesn’t work when using wildcards.

Are there any other codes you know? Is there a code for the start of a line? One for end of document? Other things like that?

---

<div class="post-metadata">

### Author: ![galt](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@galt](https://boards.straightdope.com/u/galt)
#### Post date: [January 27, 2005, 3:13am UTC](https://boards.straightdope.com/t/complex-word-search-in-ms-word/286850/4 "2005-01-27T03:13:50Z")

</div>

Lame. Sorry, that’s all I have.
