The SQL to address this is:
UPDATE hardware SET display_names = regexp_replace(display_names, E'\n$', '') WHERE display_names ~ E'\n$';
The SQL to address this is:
UPDATE hardware SET display_names = regexp_ replace( display_ names, E'\n$', '') WHERE display_names ~ E'\n$';