11.02.2016, 15:16
Added class for working with regular expressions
regex.IsMatch - Indicates whether the regular expression specified in the Regex constructor finds a match in the specified input string, beginning at the specified starting position in the string.
regex.Match - Searches the specified input string for the first occurrence of the specified regular expression.
regex.Replace -
In a specified input string, replaces all strings that match a regular expression pattern with a specified replacement string.
The names of the functions are taken from here ( https://sampforum.blast.hk/showthread.php?tid=247893 )
macro:
class regex: https://github.com/Seregamil/.NET-pl...sharp/regex.cs
example script: https://github.com/Seregamil/.NET-pl...egex/regex.pwn
regex.IsMatch - Indicates whether the regular expression specified in the Regex constructor finds a match in the specified input string, beginning at the specified starting position in the string.
regex.Match - Searches the specified input string for the first occurrence of the specified regular expression.
regex.Replace -
In a specified input string, replaces all strings that match a regular expression pattern with a specified replacement string.
The names of the functions are taken from here ( https://sampforum.blast.hk/showthread.php?tid=247893 )
macro:
PHP Code:
#define regex_match(%0,%1) callDotnetMethod("regex.Match", "ss", %0, %1)
#define regex_is_match(%0,%1) callDotnetMethod("regex.IsMatch", "ss", %0, %1)
#define regex_replace(%0,%1,%2) callDotnetMethodStr("regex.Replace", %0, sizeof(%0), "sss", %0, %1, %2)
example script: https://github.com/Seregamil/.NET-pl...egex/regex.pwn