Page 1 of 1

shrotening length of same characters words

Posted: Fri Nov 09, 2012 12:41 pm
by Aircut
i need to find any words (or punctuation) that are composed of more than 4 letters of the same character and shorten them to 4

that is

AAAAAAAAAAA -> AAAA
???????????????? -> ????
........................... -> ....
Brrrrrrrrrrrrrrrrr -> Brrr

any help would be appriciated

Re: shrotening length of same characters words

Posted: Mon Nov 12, 2012 8:35 am
by DataMystic Support
Use a perl regex search/replace

Search for

Code: Select all

([a-z\?\.]){5,}?
Replace with:

Code: Select all

$1$$1$$1$$1$

Re: shrotening length of same characters words

Posted: Mon Nov 12, 2012 1:26 pm
by Aircut
thanks but it doesnt work, i created the rule for perl pattern search/replace

in the trial box i entered
............................
no changes....

Re: shrotening length of same characters words

Posted: Mon Nov 12, 2012 2:36 pm
by DataMystic Support
Check for extra white space or carriage returns at the end of the search phrase.