From f68e174aac576f37eb86a89904756fa3179c9266 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 23 Mar 2023 17:31:58 +0100 Subject: [PATCH] Use unicode word chars to recognize hashtags in editor (#1296) --- .../Status/Sources/Status/Editor/StatusEditorViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift index 31fdba19..04253d75 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorViewModel.swift @@ -300,7 +300,7 @@ public class StatusEditorViewModel: NSObject, ObservableObject { .backgroundColor: UIColor.clear, .underlineColor: UIColor.clear], range: NSMakeRange(0, statusText.string.utf16.count)) - let hashtagPattern = "(#+[a-zA-Z0-9(_)]{1,})" + let hashtagPattern = "(#+[\\w0-9(_)]{1,})" let mentionPattern = "(@+[a-zA-Z0-9(_).-]{1,})" let urlPattern = "(?i)https?://(?:www\\.)?\\S+(?:/|\\b)"