How do we reduce repeating characters to a single character

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Post Reply
gmb1994
Posts: 7
Joined: Wed Nov 30, 2005 7:19 am
Location: Dallas, Texas, USA

How do we reduce repeating characters to a single character

Post by gmb1994 » Wed Nov 30, 2005 8:20 am

How do we reduce repeating, or multiple consecutive, characters to a single character, for example:

---- (multiple hyphens) => - (single hyphen)
aaaa (multiple letters) => a (single letter)

User avatar
DataMystic Support
Site Admin
Posts: 2217
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support » Mon Dec 05, 2005 8:57 am

Use the perl pattern

(.)\1+?

replace with

$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

Post Reply