For example suppose # denotes a special word as follows
I took a #lovely trip to the #zoo today. We had a #wonderful time. With RegEx is it possible to extract something like
#lovely#zoo#wonderful
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
string.matchMight want to tweak the regex to include numbers and symbols depending on your needs.
/#[\w\d]+/gfor letters and digits,/#\S+/gfor anything that is not whitespace.EDIT: I’ll add that the
gat the end means that it will find all matches and not only the first one.