View Single Post
Old 12-22-2021, 04:56 PM   #7
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Quote:
Originally Posted by hobnail View Post
Regex has a count/number thing where you can specify how many times it matches. I've never used it and can't remember how it works off the top of my head but I think it might be something like the following for the letters and periods for 1 to 6 repititions:

Code:
([A-Z]\.){1,6}
But check the usual helpful regex web sites for how to do it.
Actually I had thought for the Find

Code:
([A-Z]\.){2,6} 

and 

([A-Z]\.){2,6}
where there is a trailing space after the first case

That would Find A.B.C.<space> but I couldn't figure out how to do the Replace (trailing space) since it depends on the number of letters in the acronym, 3 in this case

Code:
\1\2\3
phossler is offline   Reply With Quote