Results 1 to 5 of 5
Thread: How to do search for hyphens
-
2015-07-05, 08:45 #1
- Join Date
- Mar 2001
- Posts
- 167
- Thanks
- 0
- Thanked 0 Times in 0 Posts
How to do search for hyphens
I'm using Word 2010 (Windows 7). I converted a PDF to Word and I'm trying to clean things up. I have a lot of words with hyphens in the middle of them that shouldn't be there. What sort of an expression would I use to search for these and replace what I find, minus the hyphen? Thanks.
Clark
-
2015-07-05, 08:57 #2
- Join Date
- Mar 2014
- Location
- Forever West
- Posts
- 2,149
- Thanks
- 0
- Thanked 268 Times in 257 Posts
If it were me I'd just use the Edit, Find and Replace feature to delete the hyphens. Even with an expression or macro there will still remain the issue of whether the hyphen should actually exist in some instances, hopefully spell check or grammar check will see those.
-
2015-07-05, 09:26 #3
- Join Date
- Mar 2004
- Location
- Manning, South Carolina
- Posts
- 9,811
- Thanks
- 404
- Thanked 1,567 Times in 1,420 Posts
Clark,
You can use the following regular expression in the Find what: box
Code:(<[a-z,A-Z]*>)(-)(<[a-z,A-Z])
Code:\1\3
FindandReplaceRegEx.JPG
Of course you'll try this on a COPY of your document!
HTHLast edited by RetiredGeek; 2015-07-05 at 09:29.
May the Forces of good computing be with you!
RG
PowerShell & VBA Rule!
My Systems: Desktop Specs
Laptop Specs
-
2015-07-05, 17:06 #4
- Join Date
- Jun 2011
- Location
- Hampshire (the old one)
- Posts
- 549
- Thanks
- 27
- Thanked 76 Times in 66 Posts
If you don't have any hyphens that you do want, just put a hyphen in the Find box and leave the Replace box blank. All hyphens will be replaced with...er, nothing.
-
2015-07-05, 17:40 #5
- Join Date
- May 2002
- Location
- Canberra, Australian Capital Territory, Australia
- Posts
- 5,166
- Thanks
- 2
- Thanked 455 Times in 374 Posts
For a fully-fledged macro to clean up such documents, see: http://windowssecrets.com/forums/sho...l=1#post859582
Cheers,
Paul Edstein
[MS MVP - Word]
-
The Following User Says Thank You to macropod For This Useful Post:
Charles Kenyon (2015-07-06)