Fix regex for trigger
This commit is contained in:
parent
99943b06bc
commit
106a44571c
@ -52,7 +52,7 @@ matchesTrigger phrase text =
|
||||
T.unpack text =~ pattern
|
||||
where
|
||||
pattern :: String
|
||||
pattern = "(^|\\s)" <> escapeRegex (T.unpack phrase) <> "([\\s.,!?;:]|$)"
|
||||
pattern = "(^|[[:space:]])" <> escapeRegex (T.unpack phrase) <> "([[:space:].,!?;:]|$)"
|
||||
|
||||
escapeRegex :: String -> String
|
||||
escapeRegex = concatMap esc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user