[lib] Modify markdownUserMentionRegex to match ENS names as well
Summary:
Currently, for @ mentions, we use the oldValidUsernameRegexString to detect a valid account name ([a-zA-Z0-9-_]+). Since we're now extending support to @ mention users with ENS names, names can have . in them, so we need to adjust the regex accordingly.
Rather than modifying the oldValidUsernameRegexString which is used for account validation, I stopped using oldValidUsernameRegexString when detecting @ mentions and made a separate regex string. It is pretty close to the old one, except it also adds support for .'s in names
Depends on D10387
Test Plan:
Put some log statements in matchUserMentions and made sure that the line const username = result[2]; correctly extracted ENS names.
Previously it would only match jack, but now it can match jack.eth
Reviewers: atul, ginsu, inka
Reviewed By: inka
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10388