a safer trim regex