fixed instance name parser

it can parse everything now, including dashes and capital letters in
hostnames.