Hi sandy8000,
for your question
Three or more of the same word or characters stacked at the beginning or ending of lines.
this should works for you (use a character style with a different color):
//FindChangeDoublesAtBeginAndEnd.jsx app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = '^(\\w+ )\\1+\\b'; app.changeGrepPreferences.changeTo = ''; app.changeGrepPreferences.appliedCharacterStyle = 'Your predefined character style'; app.changeGrep(); app.findGrepPreferences.findWhat = '( \\w+)\\1+\\b(?=[[:punct:]]?$)'; app.changeGrepPreferences.changeTo = ''; app.changeGrepPreferences.appliedCharacterStyle = 'Your predefined character style'; app.changeGrep(); app.findGrepPreferences = app.changeGrepPreferences = null;
Have fun
If not, give us a text example, please.