Searches and returns a string for any social accounts. Adapted from: https://stackoverflow.com/questions/15265605/how-to-pull-mentions-out-of-strings-like-twitter-in-javascript Full/Official version: https://github.com/twitter/twitter-text
The text to search.
An array of zero or more usernames.
const haystack = '@troy what is up man? Are you hanging out with @abed';const users = findUsernames(haystack); // ['@troy', '@abed'] Copy
const haystack = '@troy what is up man? Are you hanging out with @abed';const users = findUsernames(haystack); // ['@troy', '@abed']
Searches and returns a string for any social accounts. Adapted from: https://stackoverflow.com/questions/15265605/how-to-pull-mentions-out-of-strings-like-twitter-in-javascript Full/Official version: https://github.com/twitter/twitter-text