shrotening length of same characters words

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Aircut
Posts: 12
Joined: Sun Oct 28, 2012 2:09 pm

shrotening length of same characters words

Post 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
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: shrotening length of same characters words

Post 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$
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Aircut
Posts: 12
Joined: Sun Oct 28, 2012 2:09 pm

Re: shrotening length of same characters words

Post by Aircut »

thanks but it doesnt work, i created the rule for perl pattern search/replace

in the trial box i entered
............................
no changes....
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: shrotening length of same characters words

Post by DataMystic Support »

Check for extra white space or carriage returns at the end of the search phrase.
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Post Reply