(Note: string y will be uninitialized, not empty.)
As Martin says, that's as it should be. You scan for a string followed by a comma. None is found, so you get no result. It's not a regexp where you get partial results, and that is one of the things that makes it so useful.