How to appendReplace multiple values in java.util.regex.I did single value in java.util.regex. plz send one example for multiple value purpose THis is single appendReplace value code
import java.util.regex.*;
public class ReplaceAll {
public static void main(String args[]){
Pattern p = Pattern.compile("<a href"); StringBuffer buf = new StringBuffer("this is to test hyperlink <a href=http://www.k7mail.com>k7mail.com</a> just see the output and lets see what happens here it is <a href=http://www.k2mail.com> k2mail.com </a>"); Matcher m = p.matcher(buf.toString()); StringBuffer sb = new StringBuffer(); while(m.find()){
m.appendReplacement(sb,"<a target=_blank href"); } m.appendTail(sb); System.out.println("The output is "+sb.toString());