"@" is certainly allowed in this case:
However, in theses cases:
Are they 'ok' or should the "@" be encoded? Similarly, if they are 'ok', does it make the host portion "bar" and "b.com" respectively?
I took a look at the rfc (http://www.ietf.org/rfc/rfc3986.txt) and page 45 uses this example:
ftp://cnn.example.com&story=breaking_news@10.0.0.1/top_story.htm
to indicate that the "@" means "10.0.0.1" is the host, but I'm not sure because the query portion didn't start correctly (no "?"). (Also it then mentions "attacks" and I got confused.)
The background: I am trying to determine if Steven Levithan's regex is correct in parsing "http://www.foo.com/@bar" as having a host of "bar": http://stevenlevithan.com/demo/parseuri/js/