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. General Programming
  3. C#
  4. about regex: I couldn't understand why it takes 2-10 minutes? [modified]

about regex: I couldn't understand why it takes 2-10 minutes? [modified]

Scheduled Pinned Locked Moved C#
comregexhelpquestion
4 Posts 2 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
    enginco
    wrote on last edited by
    #1

    I used below project source code to make MHT, http://www.codeproject.com/KB/files/MhtBuilder.aspx[^] Below strings are problem. 1: "<link[^>]+?href\s*=\s*(?('|"")*(?[^'"">]+)('|"")*)" 2: "<i*frame[^>]+?src\s*=\s*(?['""]{0,1}(?[^'""\\>]+)['""]{0,1})" 3: "(?@import\s|\S+-image:|background:)\s*?(url)*['""(]{1,2}" & _ "(?!http)\s*/(?[^""')]+)['"")]{1,2}" In some links it takes between 2 and 10 minutes. it usually happens in external links. WHY? Thanx...

    I want to fly but I don't have wings

    modified on Wednesday, August 6, 2008 6:44 AM

    P 1 Reply Last reply
    0
    • E enginco

      I used below project source code to make MHT, http://www.codeproject.com/KB/files/MhtBuilder.aspx[^] Below strings are problem. 1: "<link[^>]+?href\s*=\s*(?('|"")*(?[^'"">]+)('|"")*)" 2: "<i*frame[^>]+?src\s*=\s*(?['""]{0,1}(?[^'""\\>]+)['""]{0,1})" 3: "(?@import\s|\S+-image:|background:)\s*?(url)*['""(]{1,2}" & _ "(?!http)\s*/(?[^""')]+)['"")]{1,2}" In some links it takes between 2 and 10 minutes. it usually happens in external links. WHY? Thanx...

      I want to fly but I don't have wings

      modified on Wednesday, August 6, 2008 6:44 AM

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      I don't know, but I suspect the doubled-quotes, try \" instead. For getting hrefs I use: "href\\s*=\\s*(?'quot'[\"'])(?'href'.*?)((?'sep'#)(?'id'.*?))?\\k'quot'"

      E 2 Replies Last reply
      0
      • P PIEBALDconsult

        I don't know, but I suspect the doubled-quotes, try \" instead. For getting hrefs I use: "href\\s*=\\s*(?'quot'[\"'])(?'href'.*?)((?'sep'#)(?'id'.*?))?\\k'quot'"

        E Offline
        E Offline
        enginco
        wrote on last edited by
        #3

        thanx your reply, vb mht code is works true but the problem is performance. Sometimes it's too slow, horrible. it takes between 2 and 10 minutes. Now I'm using SerachAroo's classes for getting local and external links. It works very good and fast. I changed the code little bit. After foound the local and external links I can find coordinates of these links with another code(the code is superman :) :) :)) After that I will add Uri.Host at the coordinates. I did it,it works very very fast but I have some problems. External link works but local links doesn't work on clik's . :) By the way I try to make single html, not mht Now I try to fix it... Do yuo have any idea?

        I want to fly but I don't have wings

        modified on Wednesday, August 6, 2008 3:38 AM

        1 Reply Last reply
        0
        • P PIEBALDconsult

          I don't know, but I suspect the doubled-quotes, try \" instead. For getting hrefs I use: "href\\s*=\\s*(?'quot'[\"'])(?'href'.*?)((?'sep'#)(?'id'.*?))?\\k'quot'"

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

          yes sir, I solved click problem in vb code I didn't use cssPattern in regex and it works fast and I have no any problems on clicks... Only one problem left. CSS :)

          I want to fly but I don't have wings

          modified on Wednesday, August 6, 2008 6:44 AM

          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