Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. regular expression for hyperlink tag

regular expression for hyperlink tag

Scheduled Pinned Locked Moved ASP.NET
helphtmlcsscomregex
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    enjoycrack
    wrote on last edited by
    #1

    Hi all, Please help me with this. I want to remove html tags, but I got a problem in this specific case the source string has something like

    <a onmouseover='This is text that has less than and greater than characters <> ... ' >I want to extract text here only</a>

    How to get the text that is between open/close <a> tags <a>...</a>? Thank you very much

    8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

    A A E 3 Replies Last reply
    0
    • E enjoycrack

      Hi all, Please help me with this. I want to remove html tags, but I got a problem in this specific case the source string has something like

      <a onmouseover='This is text that has less than and greater than characters <> ... ' >I want to extract text here only</a>

      How to get the text that is between open/close <a> tags <a>...</a>? Thank you very much

      8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

      A Offline
      A Offline
      Arun Jacob
      wrote on last edited by
      #2

      if you are asking about javascript, anchorId.innerHTML

      Arun Jacob http://codepronet.blogspot.com/

      E 1 Reply Last reply
      0
      • E enjoycrack

        Hi all, Please help me with this. I want to remove html tags, but I got a problem in this specific case the source string has something like

        <a onmouseover='This is text that has less than and greater than characters <> ... ' >I want to extract text here only</a>

        How to get the text that is between open/close <a> tags <a>...</a>? Thank you very much

        8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

        A Offline
        A Offline
        Arindam Tewary
        wrote on last edited by
        #3

        As you have mentioned that you have a Srource String which contans the whole string that you have pasted. In that case, I would assume that you have this problem in code behind. Please check whether this can be done in your case. ( remember inside the string greate than and less than should be converted to equivalent valid xml char .)

                String sXml = "<a onmouseover='This is text that has less than and greater than characters &amp;gt;&amp;lt; ... ' >I want to extract text here only</a>";
                XmlDocument xObj = new XmlDocument();
        
                xObj.LoadXml(sXml);
                MessageBox.Show(xObj.DocumentElement.ChildNodes\[0\].InnerText);
        

        Thanks, Arindam D Tewary

        E 1 Reply Last reply
        0
        • A Arindam Tewary

          As you have mentioned that you have a Srource String which contans the whole string that you have pasted. In that case, I would assume that you have this problem in code behind. Please check whether this can be done in your case. ( remember inside the string greate than and less than should be converted to equivalent valid xml char .)

                  String sXml = "<a onmouseover='This is text that has less than and greater than characters &amp;gt;&amp;lt; ... ' >I want to extract text here only</a>";
                  XmlDocument xObj = new XmlDocument();
          
                  xObj.LoadXml(sXml);
                  MessageBox.Show(xObj.DocumentElement.ChildNodes\[0\].InnerText);
          

          Thanks, Arindam D Tewary

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          Thanks, but I want to use regular expression instead of using xmlDocument. have any other idea?

          8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

          1 Reply Last reply
          0
          • A Arun Jacob

            if you are asking about javascript, anchorId.innerHTML

            Arun Jacob http://codepronet.blogspot.com/

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            No, I am asking in code behind (C# is my prefer). Thanks.

            8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

            1 Reply Last reply
            0
            • E enjoycrack

              Hi all, Please help me with this. I want to remove html tags, but I got a problem in this specific case the source string has something like

              <a onmouseover='This is text that has less than and greater than characters <> ... ' >I want to extract text here only</a>

              How to get the text that is between open/close <a> tags <a>...</a>? Thank you very much

              8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

              E Offline
              E Offline
              enjoycrack
              wrote on last edited by
              #6

              Hello everybody, anyone can help me on this? :( Thanks so much

              8x Solutions Inc. - Software Outsourcing Company in HCMC, Vietnam

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups