diff --git a/native/utils/typeahead-utils.js b/native/utils/typeahead-utils.js new file mode 100644 --- /dev/null +++ b/native/utils/typeahead-utils.js @@ -0,0 +1,11 @@ +// @flow + +import { oldValidUsernameRegexString } from 'lib/shared/account-utils'; + +// Native regex is a little bit different than web one as +// there are no named capturing groups yet on native. +const nativeTypeaheadRegex: RegExp = new RegExp( + `((^(.|\n)*\\s+)|^)@(${oldValidUsernameRegexString})?$`, +); + +export { nativeTypeaheadRegex };