If a user submits a string like:
My living room plans #plans #livingroom @cbmeeks #design @moe @larry -this is cool!
I want to have the following arrays/strings:
text = "My living room plans"
tags = ['plans', 'livingroom', 'design']
people = ['cbmeeks', 'moe', 'larry']
description = "this is cool!"
Every string submitted will start with the text piece. No @, -, etc. I don’t have to worry about a user starting with a tag or person. The breakdown should look something like this, in any order except TEXT is always first.
TEXT [-description] [#tags] [@people]
EDIT
I can’t seem to figure out how to grab them correctly. For example:
a = "My living room plans #plans #livingroom @cbmeeks #design @moe @larry -this is cool!"
/#\w+/.match(a).to_a
#=> ["#plans"] -- only grabs first one
This will automatically remove the
#,@,-, and will match in any order: