Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 #7

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
 



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