I'd like to strip out extraneous carriage returns in user edits. I'm having a devil of a time getting the replace string right, though. I'm pretty sure I'm making a simple error... anyone recognize it? $new['text'] = str_replace("/[\n|\r]{2,}/", '\n', $new['text']);