do not match (2.8) as 8) emoticon

This commit is contained in:
Nikos Kouremenos 2005-12-05 13:25:50 +00:00
parent 7636e43a2d
commit 032627a96f
1 changed files with 4 additions and 3 deletions

View File

@ -1119,11 +1119,12 @@ class Interface:
emoticons_pattern_prematch += emoticon_escaped + '|'
emoticons_pattern_postmatch += emoticon_escaped + '|'
# We match from our list of emoticons, but they must either have
# whitespace, or another emoticon next to it to match successfully
# whitespace, or another emoticon next to it to match successfully
# [\w.] alphanumeric and dot (for not matching 8) in (2.8))
emoticons_pattern = '|' + \
'(?:(?<!\w' + emoticons_pattern_prematch[:-1] + '))' + \
'(?:(?<![\w.]' + emoticons_pattern_prematch[:-1] + '))' + \
'(?:' + emoticons_pattern[:-1] + ')' + \
'(?:(?!\w' + emoticons_pattern_postmatch[:-1] + '))'
'(?:(?![\w.]' + emoticons_pattern_postmatch[:-1] + '))'
# because emoticons match later (in the string) they need to be after
# basic matches that may occur earlier