Click here to Skip to main content
15,906,645 members
Home / Discussions / C#
   

C#

 
GeneralRe: listview item backcolor - XP problem Pin
martin_hughes14-Jul-07 9:51
martin_hughes14-Jul-07 9:51 
QuestionProblems with GUI class design Pin
User 665813-Jul-07 14:06
User 665813-Jul-07 14:06 
AnswerRe: Problems with GUI class design Pin
Luc Pattyn13-Jul-07 14:38
sitebuilderLuc Pattyn13-Jul-07 14:38 
GeneralRe: Problems with GUI class design Pin
User 665814-Jul-07 0:21
User 665814-Jul-07 0:21 
GeneralRe: Problems with GUI class design Pin
Luc Pattyn14-Jul-07 1:36
sitebuilderLuc Pattyn14-Jul-07 1:36 
GeneralRe: Problems with GUI class design Pin
User 665814-Jul-07 3:20
User 665814-Jul-07 3:20 
QuestionVideo Pin
Leslie Sanford13-Jul-07 11:15
Leslie Sanford13-Jul-07 11:15 
Questioncompression Pin
mkl_0713-Jul-07 10:24
mkl_0713-Jul-07 10:24 
AnswerRe: compression Pin
Paul Conrad13-Jul-07 10:31
professionalPaul Conrad13-Jul-07 10:31 
Question[How] Screen reading for automation tasks? Pin
sbscb13-Jul-07 9:59
sbscb13-Jul-07 9:59 
AnswerRe: [How] Screen reading for automation tasks? Pin
Shy Agam13-Jul-07 11:08
Shy Agam13-Jul-07 11:08 
QuestionConcating strings... Pin
Shy Agam13-Jul-07 9:13
Shy Agam13-Jul-07 9:13 
AnswerRe: Concating strings... Pin
PIEBALDconsult13-Jul-07 9:32
mvePIEBALDconsult13-Jul-07 9:32 
AnswerRe: Concating strings... Pin
Guffa13-Jul-07 10:25
Guffa13-Jul-07 10:25 
AnswerRe: Concating strings... Pin
Luc Pattyn13-Jul-07 10:35
sitebuilderLuc Pattyn13-Jul-07 10:35 
QuestionA query regarding deployment!!! Pin
haseebbutt00713-Jul-07 8:02
haseebbutt00713-Jul-07 8:02 
AnswerRe: A query regarding deployment!!! Pin
Dave Kreskowiak13-Jul-07 8:11
mveDave Kreskowiak13-Jul-07 8:11 
GeneralRe: A query regarding deployment!!! Pin
haseebbutt00713-Jul-07 8:42
haseebbutt00713-Jul-07 8:42 
GeneralRe: A query regarding deployment!!! Pin
Dave Kreskowiak13-Jul-07 8:57
mveDave Kreskowiak13-Jul-07 8:57 
GeneralRe: A query regarding deployment!!! Pin
Larantz13-Jul-07 23:15
Larantz13-Jul-07 23:15 
GeneralRegEx bug in .NET Framework!! Pin
Dominic Pettifer13-Jul-07 7:09
Dominic Pettifer13-Jul-07 7:09 
GeneralRe: RegEx bug in .NET Framework!! Pin
Judah Gabriel Himango13-Jul-07 7:43
sponsorJudah Gabriel Himango13-Jul-07 7:43 
I just tested this snippet and it appears you're right, the app hangs. Actually, it just takes a really long time thanks to the nested quantifiers.

I just did a search on Microsoft feedback center, is this the bug you're hitting? Complex Regex evaluation hangs[^]

Microsoft has this to say on the BCL team blog[^]:

Well, actually, it doesn't hang. It just takes a really really long time, and you haven't waited long enough for it to finish. One of the pitfalls with regular expression is that you can write expressions which don't perform very well. In particular, you can end up with expressions whose search time grows exponentially with the length of the search string. I get bugs reporting that Regex hangs about once a month, and it always turns out to be an exponentially slow expression. Here's a simplified example of one of them:

([a-z]+)*=

There are two things interesting about this expression. First, notice that it has two quantifiers nested within each other. The inner one is the + quantifier for the character class, and the outer one is the *. Second, it has a character (the equals char) that must be matched at the end of the result. In English terms, this expression can be explained as

1. match any character a-z, one or more times
2. match step #1 zero or more times
3. match an equals

What will happen is that Regex will breeze through step 1 and 2 only to find that it can't match in step 3. That forces it to backtrack and try to match the first two steps differently. The trouble is that there are a lot of different ways that steps 1 and 2 can match, and Regex needs to try every single one before it can determine that the expression does not match the string.


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How could God prove Himself to humanity?
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: RegEx bug in .NET Framework!! Pin
Malcolm Smart13-Jul-07 10:34
Malcolm Smart13-Jul-07 10:34 
GeneralRe: RegEx bug in .NET Framework!! Pin
Scott Dorman13-Jul-07 10:54
professionalScott Dorman13-Jul-07 10:54 
GeneralRe: RegEx bug in .NET Framework!! Pin
Paul Conrad13-Jul-07 10:58
professionalPaul Conrad13-Jul-07 10:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.