mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2020
Posts: 3
G
Self-satisfied door
OP Offline
Self-satisfied door
G
Joined: Sep 2020
Posts: 3
Hi all. smile
I need a code that detects the repeated characters and replace the word with the original without repeating, i.e .:

hooooooowwwwww areeeee yooooou = how are you
hiiiiiiii = hi

I know there would be some problems with some characters like lowercase 'L' and so on but it doesn't matter.

Could someone help me with the code? I can't think of any way to do it.
I'm Sorry for my bad English.
Thank you very much!

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Do you want the script to detect when other use repeating characters or when you do?


Yar
Joined: Sep 2020
Posts: 3
G
Self-satisfied door
OP Offline
Self-satisfied door
G
Joined: Sep 2020
Posts: 3
Hi!
Yes, when other use repeating characters!
Thank you smile

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
This matches only when a character if followed by itself at least 2+ extra times, so it does not change the 'll' because there is only 2 of them

//var %pattern /(.)\1{2,}/g | echo -a $regsubex(foo,heeeellooo hooooooowwwwww areeeee yooooou,%pattern,\1)

Joined: Sep 2020
Posts: 3
G
Self-satisfied door
OP Offline
Self-satisfied door
G
Joined: Sep 2020
Posts: 3
Thank you very much, it was what I needed! Thank you!! grin grin


Link Copied to Clipboard