Raised This Month: $ Target: $400
 0% 

Regular expresions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-15-2009 , 06:04   Regular expresions
Reply With Quote #1

Hi.
Can you give me some explanations and examples with the use of regex.
Thanks!
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-15-2009 , 06:29   Re: Regular expresions
Reply With Quote #2

About the natives or how works the regular expressions ? If the last it will be better for you to go on sites like http://www.regular-expressions.info/

Last edited by Arkshine; 02-15-2009 at 06:34.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-15-2009 , 07:05   Re: Regular expresions
Reply With Quote #3

The use of regex module.
I want some examples, just like if vs. switch statement. Thanks.
__________________

anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-15-2009 , 07:25   Re: Regular expresions
Reply With Quote #4

http://forums.alliedmods.net/showpos...91&postcount=4 or http://forums.alliedmods.net/showpos...4&postcount=24

But it's not hard to follow what regex.inc says.

In my example, I'm using regex_compile() because the pattern will be the same and used severals times so it's better to precompile the pattern. To match a string, you will have to use regex_match_c().

Without using regex_compile(), use directly regex_match(). Don't forget to free the handle after usage, regex_free().

It's pretty easy to do and the .inc is well commented, what don't you understand ?
Arkshine 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 17:06.


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