Skip to content

Commit aa98846

Browse files
committed
Handle hyphens in user dir search porperly
1 parent 64f5a4a commit aa98846

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

synapse/storage/databases/main/user_directory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ def _parse_words_with_regex(search_term: str) -> List[str]:
12811281
Break down search term into words, when we don't have ICU available.
12821282
See: `_parse_words`
12831283
"""
1284-
return re.findall(r"([\w\-]+)", search_term, re.UNICODE)
1284+
return re.findall(r"([\w]+)", search_term, re.UNICODE)
12851285

12861286

12871287
def _parse_words_with_icu(search_term: str) -> List[str]:
@@ -1309,7 +1309,7 @@ def _parse_words_with_icu(search_term: str) -> List[str]:
13091309
# want to include those in results as they would result in syntax errors in SQL
13101310
# queries (e.g. "foo bar" would result in the search query including "foo & &
13111311
# bar").
1312-
if len(re.findall(r"([\w\-]+)", result, re.UNICODE)):
1312+
if len(re.findall(r"([\w]+)", result, re.UNICODE)):
13131313
results.append(result)
13141314

13151315
i = j

0 commit comments

Comments
 (0)