开发者

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),...

Skype smileys REGEXP patterns where/how to get?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜