Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


I fucking hate regex soo much right now

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Fafaffy
Cheater
Reputation: 65

Joined: 12 Dec 2007
Posts: 28

PostPosted: Sun Jul 08, 2012 1:32 pm    Post subject: I fucking hate regex soo much right now Reply with quote

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
View user's profile Send private message Send e-mail
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Sun Jul 08, 2012 2:42 pm    Post subject: Reply with quote

A timeout on an expression? Are you high?
Back to top
View user's profile Send private message
Fafaffy
Cheater
Reputation: 65

Joined: 12 Dec 2007
Posts: 28

PostPosted: Sun Jul 08, 2012 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites