s/((?:(?:\w+\s+){2})|\.{2})/substr($1, 0, length($1)\/2)/eg; [download]
In reply to Re: duplicate string with regular expression by pg in thread duplicate string with regular expression by abhishes