vendredi 28 octobre 2016

Extract all words with @ symbol from a string

I need to extract all @usernames from a string(for twitter) using rails/ruby:

String Examples:
"@tom @john how are you?"
"how are you @john?"
"@tom hi"

The function should extract all usernames from a string, plus without special characters disallowed for usernames... as you see "?" in an example...

Aucun commentaire:

Enregistrer un commentaire