I am trying to find a word with regular expression, but i don’t know how to use it.
I will receive a text and a word and i have to find it in the text with and without @ or #, and return true if i find it or false if dont find.
But it can’t be in another word like this: “thisword”.
It just can be alone and preceded by # or @.
How can i do this in Java ?
Example:
“the @horse is white”
“the #horse is white”
“the horse is white”
“A shorse is white”
i have to find the word horse, #horse and @horse in this three phrases.
I guess this is what you want: