in reply to Beginner question hash&RegEx

Hmm, this seems a bit dodgy, but you have a regular expression that basically looking for anything, followed by a colon followed by any 4 characters followed by "/" followed by two characters followed by "/" followed by 2 characters, followed by a colon, followed by anything. If there is a match then the four characters will be assigned to $1.

As $1 is the hash index, then whenever 2002 is encountered then the value for key 2002 is incremented

However, I should point out that the regular expression doesn't distinguish between alpha characters and digits, that the date could be in the wrong field, and probably many more issues that other monks may point out.

P.S. Is this homework?