AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Try Regex (https://forums.alliedmods.net/showthread.php?t=198804)

Bacardi 10-20-2012 18:45

Try Regex
 
1 Attachment(s)
First for all, I'm not good with these :stupid:
Secondly I looked some threads from scripting section about regex, but I didn't quite understand.
Third, sry for bad english
Fourth, lousy tutorial




My snippet

How this work





Zipped test plugin

FaTony 10-20-2012 23:16

Re: Try Regex
 
I'll share some of mine:
Valid integer (useful for StringToInt implementation):
Code:

"[+-]?\\b\\d+\\b"
Valid float (useful for StringToFloat implementation):
Code:

"[+-]?(\\b\\d+(\\.\\d+)?|(\\b\\d+)?\\.\\d+)([eE][+-]?\\d+)?\\b"
Tokenizing semicolon delimited string:
Code:

"([^;\"]+|\"[^\"]*\")+"
Tokenizing arguments of console command call:
Code:

"[\\S\"]+|\"[^\"]*\""
C++ style comment:
Code:

"//.*$"

hamilton5 10-21-2012 03:05

Re: Try Regex
 
how about http://www.regular-expressions.info/ for useful link.. ?

Bacardi 10-21-2012 04:22

Re: Try Regex
 
Quote:

Originally Posted by FaTony (Post 1822634)
I'll share some of mine:

Thanks.
Quote:

Originally Posted by hamilton5 (Post 1822723)
how about http://www.regular-expressions.info/ for useful link.. ?

Ok, thanks.


All times are GMT -4. The time now is 18:29.

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