Be fair here: if the user input varies from what the OP specifies then neither my solution nor [id://demerphq]'s stands up; if one of the
, and the other skips it altogether. Neither one is particularly good; I would argue that [id://demerphq]'s fails better, but not well.