import java.util.regex.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String texto = "oi tudo bem como vai #1234a #sdf #$%¨#@)~";
		Pattern p = Pattern.compile("#\\S+");
 		Matcher m = p.matcher(texto);
 		while(m.find()) {
 			System.out.println(m.group(0));
 		}
	}
}