#1
|
|||
|
|||
Finding words consisting only of repeated characters
Hi,
I have a technical editing macro that identifies and fixes various glitches in technical reports. I'd like to highlight instances of repeated characters, where authors have entered repeated characters to remind themselves to fill in the specifics later. For example, "The details are provided in Figure xxx." or "The system weighs yyy lb." It's typical that authors use xx, yy, or zz, so have already addressed those (see below), but would like to be able to find all instances of words consisting of only repeated characters (aaaa, bbbb, ccc, dddddd, etc) with a single search pattern. For xs, yx, and zs, I already have the following, highlighting each replacement in yellow: FindText:="(<[xX]@>)", ReplacementText:="\1" FindText:="(<[yY]@>)", ReplacementText:="\1" FindText:="(<[zZ]@>)", ReplacementText:="\1" Thanks in advance for your help! |
#2
|
||||
|
||||
You can use a wildcard Find/Replace, where:
Find = <([A-Za-z])\1@> Replace = ^& This will capture any string of two or more repeated letters that form a whole 'word'.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi Paul,
Appreciate the suggestion. Unfortunately, when I try it, it seems to find only single letter words. I also tried <([A-z])\1{2,}>, but that didn't change anything. I'm sure it's close, so will keep playing with it today ... Cheers, Dave Gaines |
#4
|
||||
|
||||
OK, use:
Find = <([A-Za-z])\1\1@>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Yessir, had the same realization; thank you kindly for your assistance!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get the list of repeated words in a text? | Accio82 | Word | 2 | 04-02-2019 10:43 PM |
Finding and Selecting Latin Characters | mohsen.amiri | Word | 1 | 01-15-2019 04:32 AM |
Find only repeated words | ugcheleuce | Word | 2 | 05-22-2018 11:12 PM |
Finding repeated words | mohsen.amiri | Word | 4 | 05-21-2018 05:05 PM |
How to Allow some repeated words and not others. | CJP1967 | Word | 3 | 04-24-2018 08:47 AM |