Just as a precautionary measure, one should not attempt to fix invalid input. Therefore a parameter failed match against valid character set (usually restricted to a-zA-Z0-9) immediatelly rejects the parameter and doesn't try to do anything else with it. Otherwise one ends up digging own hole.
the hardest line to type correctly is: stty erase ^H