I am trying to replace the content "<mml:mo data-name="OPT_ID_1438"" to "<mml:mo" using regular expression . but can't achieve it . can anyone pls help me here . what iam doing wrong .
source code:
public static void main( String[] args )
{
String strXmlTxt="<mml:mo data-name=\"OPT_ID_1438\" stretchy=\"true\">";
strXmlTxt = strXmlTxt.replace("<mml:mo data-name=\"OPT_ID_1438\"","<mml:mo");
String strXmlTxt1 = strXmlTxt.replace("<mml:mo data-name=\"(.*?)\">","<mml:mo>");
System.out.println(""+strXmlTxt);
System.out.println(""+strXmlTxt1);
}
Thanks in advance.