I need to parse a sentence.
If I find a hash in the sentence, I would like to bold it.
Example : Bonjour #hello Hi => Bonjour #hello Hi
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.
Seems like a good situation for regex
I’d do something like this
In this case we’re matching a literal hash
#plus a word of any length\w+and group it between()so we can use the$1substitions in the Regex.Replace functionUpdated jQuery doing the same thing.
Something like:
HTML
jQuery