Fixed formatting with trim and regex to find ip address