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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-04-2009 , 19:08   Re: [HELP] I have a problem with regex in my plugin.
Reply With Quote #1

The biggest mistake is that g_arrszWords is an array of single cells when it needs to be an array of strings.

I've never had to use "/pattern/", I've only needed "pattern" and case insensitivity can be acheived using a flag on the regex_match function.

Also, take a look at this:

http://wiki.amxmodx.org/Advanced_Scr...ar_Expressions
__________________
fysiks is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-04-2009 , 20:02   Re: [HELP] I have a problem with regex in my plugin.
Reply With Quote #2

PHP Code:
if (nNumber >= 1) {
   
//server_print("regexok") // debug line
   
return true
  
}
 
  
// Free the regex memmory.
  
regex_free(rgxMatch)
 }
 return 
false 
}

--->
 
  
// Free the regex memmory.
  // You must do this no matter what(I think, I don't know anything about regex)
  // and when you returned true it stopped the funcion without doing this.
  
regex_free(rgxMatch);
 }
 return 
nNumber true false;

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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