From b372ed7fde21ac5e18546c7eddd49ca916799493 Mon Sep 17 00:00:00 2001 From: David Tabaka Date: Sun, 20 Dec 2020 12:50:36 +0200 Subject: [PATCH] feat: enchanted mention regex to accept word characters and "-" resolves 2 point of #9 --- src/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 3347faf..97c0afd 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -4,7 +4,7 @@ import { StyleProp, TextStyle } from 'react-native'; import matchAll from 'string.prototype.matchall'; import { MentionData, Part, Position, RegexMatchResult, Suggestion } from '../types'; -const mentionRegEx = /(?@\[(?([^@[]*))]\((?([0-9]*))\))/gi; +const mentionRegEx = /(?@\[(?([^@[]*))]\((?([\d\w-]*))\))/gi; const defaultMentionTextStyle: StyleProp = {fontWeight: 'bold', color: '#4f69f3'};