Results 1 to 4 of 4
  1. #1
    masterrs.mind is offline Member
    Join Date
    Feb 2010
    Posts
    20
    Rep Power
    0

    Default How to remove all html tags within my <H1> tag

    Hi All,

    I have a string like this

    <H1>Main Page:<BR><BR></H1>

    I need a way to remove <BR><BR> tags within my <H1></H1>,but keep the text(Main Page:).Some times there might be <a> tags and <IMG> tags within my <H1></H1>.

    Can some one give me a Regexp for it.


    Please give me a solution.

    Thanks.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Try on Regular Expression Library You can write your regular expression there and test easily.

    How you going to do this? Reading line by line and do the matching?

  3. #3
    masterrs.mind is offline Member
    Join Date
    Feb 2010
    Posts
    20
    Rep Power
    0

    Default

    Hi,

    Thanks for the reply.I am using parser to solve it,because I was not able figure out a way using Regexps.Now I am able to get only the text within <H1></H1>

    Thanks.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Yeah that's what I want to point actually. When you are using regex to find the required pattern it's difficult to track the content segment to search it. Parser would be better, you can track the start point and end point easily.

Similar Threads

  1. Help with html tags in java
    By peliukasss in forum New To Java
    Replies: 5
    Last Post: 02-03-2010, 06:13 AM
  2. Need help in validation HTML tags
    By nn12 in forum New To Java
    Replies: 1
    Last Post: 09-09-2008, 04:18 AM
  3. HTML tags anyone?
    By tim in forum Suggestions & Feedback
    Replies: 2
    Last Post: 06-29-2008, 04:49 AM
  4. Html tags within XML- need help
    By iamhappy in forum XML
    Replies: 2
    Last Post: 03-27-2008, 04:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •