fix an error: String#match().length fails when match returns null