Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hi priya see this question...

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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());
}
}
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
DO NOT CROSSPOST!
Kyle
 
    Bookmark Topic Watch Topic
  • New Topic