Fixed a problem with zero length strings

Passing in a zero length string used to cause a crash because the match
function can return null.