Hi priya ..
Actually this is not websphere related..but I posted in
java advanced and intermediate..but I hope will get response from u..thats why I am specifying ur name..at subject..sorry for that..
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 mean below program is we are taking "href" ...we are using this prg..where "href" is there..that place is changining what ever we are declared..but I want to.. "href" and "form" like we are spcifying.. suppose we want to change href place is
"href value" and "form" place is "form value " like that..this is jdk1.4 java.util.regex package... I hope to get ur response...
THis is single appendReplace value code
import java.util.regex.*;
public class multiplevalues
{
public static void main(
String args[])
{
String patternStr = "href";
Pattern p = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);
String sb1="
k7mail.com and this
k7mail.com";
StringBuffer buf=new StringBuffer(sb1);
Matcher m = p.matcher(sb1);
System.out.println("Input is: "+buf.toString());
String kk=buf.toString();
StringBuffer sb=new StringBuffer();
while(m.find())
{
m.appendReplacement(sb,"href target=_blank");
}
m.appendTail(sb);
System.out.println("Out put is : "+sb.toString());
}
}