/* package whatever; // don't place package name! */
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String value
= "adapter-UDP02_sistem10_a.log"; Pattern pattern = Pattern.compile("-(.*?)_");
Matcher matcher = pattern.matcher(value);
if (matcher.find()) {
System.
out.
println( matcher.
group(1) ); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC5yZWdleC5QYXR0ZXJuOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lk1hdGNoZXI7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN0cmluZyB2YWx1ZSA9ICJhZGFwdGVyLVVEUDAyX3Npc3RlbTEwX2EubG9nIjsKCQlQYXR0ZXJuIHBhdHRlcm4gPSBQYXR0ZXJuLmNvbXBpbGUoIi0oLio/KV8iKTsKCQlNYXRjaGVyIG1hdGNoZXIgPSBwYXR0ZXJuLm1hdGNoZXIodmFsdWUpOwoJCQoJCWlmIChtYXRjaGVyLmZpbmQoKSkgewoJCQlTeXN0ZW0ub3V0LnByaW50bG4oIG1hdGNoZXIuZ3JvdXAoMSkgKTsKCQl9Cgl9Cn0=