AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Regular expresions (https://forums.alliedmods.net/showthread.php?t=85726)

anakin_cstrike 02-15-2009 06:04

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

Arkshine 02-15-2009 06:29

Re: Regular expresions
 
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/

anakin_cstrike 02-15-2009 07:05

Re: Regular expresions
 
The use of regex module.
I want some examples, just like if vs. switch statement. Thanks.

Arkshine 02-15-2009 07:25

Re: Regular expresions
 
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 ?


All times are GMT -4. The time now is 17:06.

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