/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String p
= "((?<!\\p{L})(?=\\d(?=(?:[- _]*\\d){3,4}(?!\\p{L})))|(?!^)\\G)[- _]?\\d(?!\\d*\\p{L})"; System.
out.
println("0000".
replaceAll(p,
"*")); System.
out.
println("any text 000 00 more texts".
replaceAll(p,
"*")); System.
out.
println("any text 000 00 more texts 00".
replaceAll(p,
"*")); System.
out.
println("any text 000 00 more texts 00 00".
replaceAll(p,
"*")); System.
out.
println("any text 00-00 more texts 00_00".
replaceAll(p,
"*")); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN0cmluZyBwID0gIigoPzwhXFxwe0x9KSg/PVxcZCg/PSg/OlstIF9dKlxcZCl7Myw0fSg/IVxccHtMfSkpKXwoPyFeKVxcRylbLSBfXT9cXGQoPyFcXGQqXFxwe0x9KSI7CgkJU3lzdGVtLm91dC5wcmludGxuKCIwMDAwIi5yZXBsYWNlQWxsKHAsICIqIikpOwoJCVN5c3RlbS5vdXQucHJpbnRsbigiYW55IHRleHQgMDAwIDAwIG1vcmUgdGV4dHMiLnJlcGxhY2VBbGwocCwgIioiKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKCJhbnkgdGV4dCAwMDAgMDAgbW9yZSB0ZXh0cyAwMCIucmVwbGFjZUFsbChwLCAiKiIpKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oImFueSB0ZXh0IDAwMCAwMCBtb3JlIHRleHRzIDAwIDAwIi5yZXBsYWNlQWxsKHAsICIqIikpOwoJCVN5c3RlbS5vdXQucHJpbnRsbigiYW55IHRleHQgMDAtMDAgbW9yZSB0ZXh0cyAwMF8wMCIucmVwbGFjZUFsbChwLCAiKiIpKTsKCX0KfQ==