I would do it in a two phases:
First split the input in a username and a password with a regular expression
dim re, matches, match, test
Set re = new regexp
re.pattern = "^((.*)\\)?(.*)$"
for each test in array( _
Set matches = re.Execute(test)
for each match in matches
msgbox "domain: " & match.submatches(1) & vbNewLine & _
"username: " & match.submatches(2)
Then, Use a Select Case to make the domainname valid:
dim localhost, testdomain, outputDomain
localhost = "192.168.0.1"
for each testDomain in array( _
select case testDomain
case localhost, "", "."
outputDomain = localhost
outputDomain = testDomain
msgbox testDomain & " becomes " & outputDomain
Combine these two and you have your script to get the domain and username.
Disclaimer: The above code is tested examplecode, but you have to adapt it to your specific situation.