/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Pattern;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String s
= "<><PALAVRA outrapalavra>palavra</PALAVRA>"; String replace
= "NovaPalavra";
Pattern p = Pattern.compile("<(/?)(.*?)("+parametro+")(.*?)>", Pattern.CASE_INSENSITIVE);
s = p.matcher(s).replaceAll("<$1$2"+replace+"$4>");
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguUGF0dGVybjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU3RyaW5nIHMgPSAiPD48UEFMQVZSQSBvdXRyYXBhbGF2cmE+cGFsYXZyYTwvUEFMQVZSQT4iOwoJCVN0cmluZyBwYXJhbWV0cm8gPSAicGFsYXZyYSI7CgkJU3RyaW5nIHJlcGxhY2UgPSAiTm92YVBhbGF2cmEiOwoJCQoJCVBhdHRlcm4gcCA9IFBhdHRlcm4uY29tcGlsZSgiPCgvPykoLio/KSgiK3BhcmFtZXRybysiKSguKj8pPiIsIFBhdHRlcm4uQ0FTRV9JTlNFTlNJVElWRSk7CgkJcyA9IHAubWF0Y2hlcihzKS5yZXBsYWNlQWxsKCI8JDEkMiIrcmVwbGFjZSsiJDQ+Iik7CgkJCgkJU3lzdGVtLm91dC5wcmludChzKTsKCX0KfQ==