Yes, I get the difference between white and black listing, I’m just used to being applied to access, not to characters.
This is a section on algorithms, not internet security.
Are you saying that this approach is a danger to the computer’s security? I’m no security expert by any means, but I fail to see how this poses a risk.
If you’re saying that it is “dangerous” because it might contain some unprintable character, etc. then I’d say that is true of any user input. Yes, there are better ways to “sanitize” user input, but the blurb doesn’t claim that this is a method to sanitize input completely, nor does it even say that it is user input.
I think the purpose is just test regex skills with a silly problem. When teaching, it is important not to overwhelm the student with too many complications too early.
I appreciate your concerns, but I disagree with them in this case. Maybe someone else will pipe in that has something different to say.