source-engine/vscript/squirrel/samples/regex.nut
tupoy-ya bba4bb4625
feat(VScript): Added vscript from mapbase.
Does not work, for the most part.
2023-10-04 12:02:54 +05:00

11 lines
352 B
Plaintext

local ex = regexp("[a-zA-Z]+");
local string = "123 Test; strlen(str);";
local res = ex.search(string);
print(string.slice(res.begin,res.end)); //prints "Test"
print("\n");
ex = regexp(@"\m()");
string = "123 Test; doSomething(str, getTemp(), (a+(b/c)));";
res = ex.search(string);
print(string.slice(res.begin,res.end)); //prints "(...)"
print("\n");