Skype smileys REGEXP patterns where/how to get?
I would like to understand the patterns they a开发者_如何学Gore using for their smileys.
If emoticons are only replaced if surrounded by whitespace or (presumably) at start/end of a line/string, then you can use a series of regexes.
Using this list (taken from http://www.skype-forum.com/ftopic13197.html),...
you can construct these like this:
(?<=^|\s)<<smiley regex>>(?=\s|$)
will match <<smiley regex>>
only if it's on its own.
Examples for <<smiley regex>>
:
:-?\) :-?\( :-?D 8\)
;\( \(sweat\) :\| :\*
:\$ :\^\) \|-\) \|\(
;\) \]:\) \(talk\) \(yawn\)
\(doh\) :@ \(wasntme\) \(party\)
etc. - you'll need to escape a lot of special-meaning characters for use in a regex. Your language might have a re.escape()
function for this.
精彩评论