How about id.substring(7) instead of the regexp?  Or define an ID_PREFIX = 'custom:' variable and then do id.substring(ID_PREFIX.length).