How do we reduce repeating characters to a single character

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Postby 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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Use the perl pattern

(.)\1+?

replace with

$1
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 1 guest