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)
How do we reduce repeating characters to a single character
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2229
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Use the perl pattern
(.)\1+?
replace with
$1
(.)\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
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