in reply to Beginner question hash&RegEx

Thnaks for your answers, it's the answer from a student in an exam. I try to understand what he makes...
now with your help, I know what happens in this prog,thanks.