The title may sound odd, but im kind of trying to set up this preg_replace that takes care of messy writers for a textarea. It has to:
- $result = preg_replace('/!+/', '!', $subject);
- $result = preg_replace('/\.*,/', ',', $subject);
- $result = preg_replace('/\s+(?=,)/', '', $subject);
- $result = preg_replace('/^,*|,*$/', '', $subject);
- $result = preg_replace('/([a-z])\1+/i', '$1$1', $subject);
- $result = preg_replace('/,(?!\s)/', ', ', $subject);
One by one matching to your rules :)