I have a website which allows users to comment on photos. Of course, users leave comments like:
\'OMGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
Edit : awful suggestion, please don't read, I truly deserve my -1 :)
I found here on technical nuggets something like what you're looking for.
There's nothing to do except a very long regex, because I've never heard about a regex sign for repetition ...
It's a total example, I won't paste it here but I think this will totally answer your question.