mirror of https://github.com/zulip/zulip.git
f1a8209705
The previous regular expression required a `[^\w]` at the start and end of the match. This had two unintended effects -- it meant that it could never match at the start or end of a string, and it meant that *adjacent* words required *two* non-word characters between them, as the pattern matches cannot overlap. Switch to allowing string start/end to anchor the matches, and make the trailing `[^\w]` be a zero-width look-ahead, to allow the patterns to overlap. Also remove the spurious `^` within the inner character classes, which prevented `*foo^bar*` from matching. Finally, add tests to cover the functionality, which was previously untested. |
||
---|---|---|
.. | ||
fixtures | ||
__init__.py | ||
doc.md | ||
tests.py | ||
view.py |