Raised This Month: $ Target: $400
 0% 

[HELP] I have a problem with regex in my plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
unSeen
Member
Join Date: Sep 2008
Old 04-05-2009 , 09:51   Re: [HELP] I have a problem with regex in my plugin.
Reply With Quote #1

I tried what you said, and when I looked at it again, it's the same. but your idea is more effectivity.
It still returns me the same error in the server runtime plugin debug. (-debug)

I copied it:

Code:
L 04/05/2009 - 16:43:15: [AMXX] Plugin file open error (plugin "commands")
L 04/05/2009 - 16:44:43: [REGEX] Invalid regex handle -1
L 04/05/2009 - 16:44:43: [AMXX] Displaying debug trace (plugin "flame_detector.amxx")
L 04/05/2009 - 16:44:43: [AMXX] Run time error 10: native error (native "regex_free")
L 04/05/2009 - 16:44:43: [AMXX]    [0] flame_detector.sma::isFound (line 165)
L 04/05/2009 - 16:44:43: [AMXX]    [1] flame_detector.sma::FlameHandler (line 117)

Any suggestions?


(btw if i didn't say that, i appreaciate you'r help! thank!)
__________________
List of important things:
1. Respect you'r mother.
2. Respect you'r father.
3. Do not hit anyone.
4. Do not steal.
5. Do not flame.
7. You didn't see that there is no number 6.
8. You checked if number 7 is true.
9. You are laughing now.
10. You are double laughing because you understand the joke ;)
unSeen is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-05-2009 , 10:57   Re: [HELP] I have a problem with regex in my plugin.
Reply With Quote #2

From that link:
PHP Code:
if (re >= REGEX_OK)
{
    new 
str2[64]
    new 
i
    
//since it returned REGEX_OK, num has
    // the number of substrings matched by the pattern.
    //the first substring (0) seems to match the whole string.
    
for (i=0i<numi++)
    {
        
regex_substr(reistr263)
        
server_print("Substring %d: %s"istr2)
    }
    
//the regular expression matcher uses memory.
    //you must free it if you get REGEX_OK
    //This will also set re to 0.
    
regex_free(re)

You can only free the regex handle if you found a match (i.e. handle >= REGEX_OK). I would use the above if() statement instead of if( nNumber >= 1).

Problem fixed .
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode