• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regular Expression  RSS feed

 
kaparapu madhu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to get all html tags from the html file

ex:1)
input: <h2><a name="5"></a> Limitations<br>
output: <h2><a name="5"></><br>
-----------------------------------------------
ex:2)
input: <font color="#990033">Functions unit tests</font> <font color="#990033">automation:</font><br>

output: <font color="#990033></fon><font color="#990033></font><br>
--------------------------------------------------
Error:
ex:3)
input: <li>SetPropertyValue root.Logic.UnitTesting.Logs
output:<li>SetPropertyValue root.Logic.UnitTesting.Logs

in this input i am not getting valid out put
i have to get only <li> but i am not getting
----------------------------------------------------------
Error:
ex:4)
input: SetPropertyValue <b>root.usr.local</b>
output:SetPropertyValue <b>root.usr.local</b>

in this input i am not getting valid out put
i have to get <b></b> but i am not getting

-----------------------------------------------------------
i have used the following regular expression

line = line.replaceAll("(>.[^<>]*< ", "><");

please help me...............
 
Alan Moore
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you're processing the file line by line. If that's the case, try this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!