I'm trying to write some regex to catch instances of characters that are
repeated more than x times in a string and replace them with a single
occurence of the same character. So far I've failed :)
For example, if x was 10 and my string was:
"this is myyyy striiiiiiiiiiiiiiiiing _________________ and I want my
striiiing to change"
then I would like my string to become:
"this is myyyy string _ and I want my striiiing to change"
I've been trying combinations of the dot to match any character, curly
brackets to specify the number of charcters {10} and backreferences to try
and catch the character but I haven't even got close.
Any one got any ideas? Is this even possible?
Thanks for any help.
Gareth
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244736
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54