Remove set of unused variables.
Add a new matching rule \m that behaves similar to lua %b, it matches a balanced open and close characters ex: \m() <- will match a balanced pair of ( and ) \m{} <- will match a balanced pair of { and } See lua %b for more info. Also include a nut file as example.
This commit is contained in:
10
samples/regex.nut
Normal file
10
samples/regex.nut
Normal file
@@ -0,0 +1,10 @@
|
||||
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");
|
Reference in New Issue
Block a user