summaryrefslogtreecommitdiff
path: root/alot/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'alot/addressbook')
-rw-r--r--alot/addressbook/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/alot/addressbook/__init__.py b/alot/addressbook/__init__.py
index fbd95a99..f30c7274 100644
--- a/alot/addressbook/__init__.py
+++ b/alot/addressbook/__init__.py
@@ -34,9 +34,8 @@ class AddressBook(object):
def lookup(self, query=''):
"""looks up all contacts where name or address match query"""
res = []
- query = '.*%s.*' % query
+ query = re.compile('.*%s.*' % query, self.reflags)
for name, email in self.get_contacts():
- if re.match(query, name, self.reflags) or \
- re.match(query, email, self.reflags):
+ if query.match(name) or query.match(email):
res.append((name, email))
return res