print "ends with x and optional y or z\n" if /x(y|z)?\n$/;