Skip to content

Commit

Permalink
Removed redundant escapes in regexps
Browse files Browse the repository at this point in the history
  • Loading branch information
gbin committed Apr 14, 2017
1 parent 578e6aa commit 7ba082d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion errbot/backends/graphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def keyPressEvent(self, *args, **kwargs):
super().keyPressEvent(*args, **kwargs)


urlfinder = re.compile(r'http([^\.\s]+\.[^\.\s]*)+[^\.\s]{2,}')
urlfinder = re.compile(r'http([^.\s]+\.[^.\s]*)+[^.\s]{2,}')

backends_path = os.path.join(os.path.dirname(errbot.__file__), 'backends')

Expand Down
2 changes: 1 addition & 1 deletion errbot/backends/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ def sanitize_uris(text):
:returns:
string
"""
text = re.sub(r'<([^\|>]+)\|([^\|>]+)>', r'\2', text)
text = re.sub(r'<([^|>]+)\|([^|>]+)>', r'\2', text)
text = re.sub(r'<(http([^>]+))>', r'\1', text)

return text
Expand Down
2 changes: 1 addition & 1 deletion tests/commands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_backup(testbot):
bot.push_message('!backup')
msg = testbot.pop_message()
assert 'has been written in' in msg
filename = re.search(r"'([A-Za-z0-9_\./\\-]*)'", msg).group(1)
filename = re.search(r"'([A-Za-z0-9_./\\-]*)'", msg).group(1)

# At least the backup should mention the installed plugin
assert 'errbotio/err-helloworld' in open(filename).read()
Expand Down

0 comments on commit 7ba082d

Please sign in to comment.