Press enter in input, get ip or fail based on regex