I want to find the words that start with a \"#\" sign in a string in java. There can be spaces between the sign and the word as well.
The string \"hi #how are # yo
Here's a non-regular expression approach...
Replace all occurrences of a # followed by a space in your string with a #
myString.replaceAll("\s#", "#")
NOw split the string into tokens using the space as your delimited character
String[] words = myString.split(" ")
Finally iterate over your words and check for the leading character
word.startsWith("#")