Browse Source

changed the regexp to include everything except punctuation. I think it may go all around (greedy), though.

master
Julio Biason 14 years ago
parent
commit
3661926e5a
  1. 5
      mitterlib/network/twitter.py

5
mitterlib/network/twitter.py

@ -26,6 +26,7 @@ import htmlentitydefs
import re import re
import warnings import warnings
import gettext import gettext
import string
from httplib import BadStatusLine from httplib import BadStatusLine
from socket import error as socketError from socket import error as socketError
@ -172,10 +173,10 @@ class TwitterNetworkData(NetworkData):
self.message = _unhtml(data['text']) self.message = _unhtml(data['text'])
# regular expression for users # regular expression for users
self.user_regexp = r'@\w+' self.user_regexp = r'@[^ ' + string.punctuation + ']'
# regular expression for hashtags # regular expression for hashtags
self.tag_regexp = r'#\w+' self.tag_regexp = r'#[^ ' + string.punctuation + ']'
return return

Loading…
Cancel
Save