Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2020, 05:49 PM
Dave Gaines Dave Gaines is offline Finding words consisting only of repeated characters Windows 10 Finding words consisting only of repeated characters Office 2019
Novice
Finding words consisting only of repeated characters
 
Join Date: Feb 2020
Posts: 5
Dave Gaines is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 02-28-2020, 02:59 AM
macropod's Avatar
macropod macropod is offline Finding words consisting only of repeated characters Windows 7 64bit Finding words consisting only of repeated characters Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 02-28-2020, 06:20 AM
Dave Gaines Dave Gaines is offline Finding words consisting only of repeated characters Windows 10 Finding words consisting only of repeated characters Office 2019
Novice
Finding words consisting only of repeated characters
 
Join Date: Feb 2020
Posts: 5
Dave Gaines is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 02-28-2020, 06:27 AM
macropod's Avatar
macropod macropod is offline Finding words consisting only of repeated characters Windows 7 64bit Finding words consisting only of repeated characters Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, use:
Find = <([A-Za-z])\1\1@>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-28-2020, 06:35 AM
Dave Gaines Dave Gaines is offline Finding words consisting only of repeated characters Windows 10 Finding words consisting only of repeated characters Office 2019
Novice
Finding words consisting only of repeated characters
 
Join Date: Feb 2020
Posts: 5
Dave Gaines is on a distinguished road
Default

Yessir, had the same realization; thank you kindly for your assistance!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding words consisting only of repeated characters 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
Finding words consisting only of repeated characters Find only repeated words ugcheleuce Word 2 05-22-2018 11:12 PM
Finding words consisting only of repeated characters 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft