Actually i have string in java having the some html content now i want to replace with some other html content by using regular expressions in java
String htmlData="<textarea style="display:none"/> some other data here <textarea/> some more other data here <input type="text"/>";
Now i want to replace like the following :
String htmlData="<textarea style="display:none"></textarea> some other data here <textarea></textarea> some more other data here <input type="text"/>";
means that i need to change all self close textarea tags to right syntax textarea tags.
Here is what I tried:
String htmlData = htmlData.replace("<textarea/>","<textarea></textarea>");
But how can I find textarea nodes that have attributes ?