// Collection of code snippets by Arne Vajhøj
// posted to eksperten.dk, usenet and other places (2002-now)
public class RegexReplace {
public static void main(String[] args) {
String s = "\r\n" +
"\r\n" +
"localhost\r\n" +
"8080\r\n" +
"\r\n" +
"\r\n";
System.out.println(s);
s = s.replaceAll("(]*>)([^<]*)()", "$1Temp1$3");
s = s.replaceAll("(]*>)([^<]*)()", "$1Temp2$3");
System.out.println(s);
}
}