import java.util.regex.*;
class Ideone
{
{
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)); }
}
}
aW1wb3J0IGphdmEudXRpbC5yZWdleC4qOwoKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN0cmluZyB0ZXh0byA9ICJvaSB0dWRvIGJlbSBjb21vIHZhaSAjMTIzNGEgI3NkZiAjJCXCqCNAKX4iOwoJCVBhdHRlcm4gcCA9IFBhdHRlcm4uY29tcGlsZSgiI1xcUysiKTsKIAkJTWF0Y2hlciBtID0gcC5tYXRjaGVyKHRleHRvKTsKIAkJd2hpbGUobS5maW5kKCkpIHsKIAkJCVN5c3RlbS5vdXQucHJpbnRsbihtLmdyb3VwKDApKTsKIAkJfQoJfQp9