Regex
Want to replace all char sequence starting with & and ending with ; to
a single letter # .
Tried the following but out put is :
test&atest#this &otest# string
Any idea / tutorial which can solve this problem ..
import java.util.regex.*;
publicclass StringTest
{
publicstaticvoid main(String args[])
{
String str ="test&atest;this &Otest; string";
String regex ="&*;";
String s = Pattern.compile(regex).matcher(str).replaceAll("#");
System.out.println(s);
}
}

