regex preformance issue
-
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
-
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
Hi, this regex should do the match:
([^,]*,){2}1\.0\.0,([^,]*,){7}
/cadi 24 hours is not enough -
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
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