Make regexp trim substantially faster