Almost.  This "rule" was actually Jesus' response to a hypothetical posed by certain Pharisees: "Is it lawful for a man (male) to divorce his wife, for any reason?  Jesus NEVER answered that question, but counseled against divorce without reference to a "rule" forbidding divorce, or creating such a rule.