[fixes #84] make extracting information from the toString method less brittle

<string>.match(<regex>) will return null if nothing is found
Merge pull request #85 from stefanpenner/more-resiliant-match

[fixes #84] make extracting information from the toString method less brittle