def emojize(text):
 pattern = re.compile('(::[a-z0-9\\+\\-_]+::)')
 def emorepl(match):
  value = match.group(1)
  if (value in emojiCodeDict):
   return emojiCodeDict[value]
 return pattern.sub(emorepl, text)

def emojize ( text ) : pattern = re . compile ( '(::[a-z0-9\\+\\-_]+::)' ) def emorepl ( match ) : value = match . group ( 1 ) if ( value in emojiCodeDict ) : return emojiCodeDict [ value ] return pattern . sub ( emorepl , text )
emoji regex .