mIRC Home    About    Download    Register    News    Help

Print Thread
G
gabriel_
gabriel_
G
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: 182
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 182
Do you want the script to detect when other use repeating characters or when you do?

G
gabriel_
gabriel_
G
Hi!
Yes, when other use repeating characters!
Thank you smile

Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
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)

G
gabriel_
gabriel_
G
Thank you very much, it was what I needed! Thank you!! grin grin


Link Copied to Clipboard