 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Fafaffy Cheater
Reputation: 65
Joined: 12 Dec 2007 Posts: 28
|
Posted: Sun Jul 08, 2012 1:32 pm Post subject: I fucking hate regex soo much right now |
|
|
My CEF Game program was working flawlessly. Everything was accounted for, and everything worked smoothly. The only problem was it would occasionally freeze when searching through posts.
I tried everything, I kept doing failsafes, and kept logging everything.
After hours of debugging, I finally figured out the problem:
Regex occasionally likes to scan a pattern forever, and never time out. I had to switch my program to .NET Framework 4.5, and manually set a timeout
Honestly, why the fuck doesn't regex have like a default 1 minute timeout on any framework? Why only 4.5?
Well, now I figured out the problem, and my program is working as smooth as butter
/rant
|
|
| Back to top |
|
 |
Aniblaze Grandmaster Cheater Supreme
Reputation: 138
Joined: 23 Apr 2006 Posts: 1757 Location: The Netherlands
|
Posted: Sun Jul 08, 2012 2:42 pm Post subject: |
|
|
| A timeout on an expression? Are you high?
|
|
| Back to top |
|
 |
Fafaffy Cheater
Reputation: 65
Joined: 12 Dec 2007 Posts: 28
|
Posted: Sun Jul 08, 2012 2:45 pm Post subject: |
|
|
| Aniblaze wrote: | | A timeout on an expression? Are you high? |
Part of my code:
| Code: | try {
foreach(Match mch in Regex.Matches(source, @"REGEXCODE", RegexOptions.None, TimeSpan.FromSeconds(5)))
{
}
}
catch (RegexMatchTimeoutException ex) {
Log("Regex exception!" + ex.ToString());
} |
And yes, it sometimes does get timeout exceptions.
Also:
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.matchtimeout(v=vs.110).aspx
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|