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. regex preformance issue

regex preformance issue

Scheduled Pinned Locked Moved C#
algorithmsregexhelptutorialquestion
3 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
    eggie5
    wrote on last edited by
    #1

    Hi, I have this string, ",(None Active),1.0.0,1074005504,AL2000000,1_271005132951,ALLTEL,ripItem_271005132951,BREW Application,Operater Managed Item,27-OCT-2005 13:30:00;" and I run this regex against it, "([\w\s]+)*,([\w\s]+)*,1\.0\.0,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*" When ever I run my code, or run the expression in Expresso, the regex engine freezes up or something and doesn't stop searching. Is there something wrong with my regex? Is there a way to modify it to make it more efficient? What it basically needs to do is ignore anything that's in between a comma (,) as you can see by the example, it ignores every value in the string excepts for the "1.0.0" /\ |_ E X E GG

    C E 2 Replies Last reply
    0
    • E eggie5

      Hi, I have this string, ",(None Active),1.0.0,1074005504,AL2000000,1_271005132951,ALLTEL,ripItem_271005132951,BREW Application,Operater Managed Item,27-OCT-2005 13:30:00;" and I run this regex against it, "([\w\s]+)*,([\w\s]+)*,1\.0\.0,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*" When ever I run my code, or run the expression in Expresso, the regex engine freezes up or something and doesn't stop searching. Is there something wrong with my regex? Is there a way to modify it to make it more efficient? What it basically needs to do is ignore anything that's in between a comma (,) as you can see by the example, it ignores every value in the string excepts for the "1.0.0" /\ |_ E X E GG

      C Offline
      C Offline
      Carsten Zeumer
      wrote on last edited by
      #2

      Hi, this regex should do the match: ([^,]*,){2}1\.0\.0,([^,]*,){7} /cadi 24 hours is not enough

      1 Reply Last reply
      0
      • E eggie5

        Hi, I have this string, ",(None Active),1.0.0,1074005504,AL2000000,1_271005132951,ALLTEL,ripItem_271005132951,BREW Application,Operater Managed Item,27-OCT-2005 13:30:00;" and I run this regex against it, "([\w\s]+)*,([\w\s]+)*,1\.0\.0,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*,([\w\s]+)*" When ever I run my code, or run the expression in Expresso, the regex engine freezes up or something and doesn't stop searching. Is there something wrong with my regex? Is there a way to modify it to make it more efficient? What it basically needs to do is ignore anything that's in between a comma (,) as you can see by the example, it ignores every value in the string excepts for the "1.0.0" /\ |_ E X E GG

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

        I found out what the problem was... I was using grouping (...) unecessarly. When you use grouping the regex engine creates a sort of variable (slowing things down), when I wasn't even using the grouping.. I just copied it from some example I saw. My whole regex opperstion only takes 9 seconds now, compared to never ending. /\ |_ E X E GG

        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