In regex, the . character means "any character". To use a literal . you must escape it like this: \.

on $*:SOCKOPEN:/sock\./:{

However, in this case, there is no reason to use regex. A simple wildcard would be sufficient.

on *:SOCKOPEN:sock.*:{

-genius_at_work