updated sample code using match()
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
hyung-hwan 2024-08-18 00:14:47 +09:00
parent 7ff4b3a812
commit 9953e5c66b

View File

@ -1859,13 +1859,13 @@ int hawk_fnc_match (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
str::match("abcdefgdefx", "def", 7); str::match("abcdefgdefx", "def", 7);
------------------------------------ ------------------------------------
str::match("ab\uB098cdefgdefx", /(def)g(.+)/, 1, x); str::match("ab\uB098cdefgdefx", /(def)g(.+)/, 1, x);
q = length(x) / 2; q = length(x) / 3;
for (i = 1; i <= q; i++) print x[i,"start"], x[i,"length"]; for (i = 1; i < q; i++) print x[i,"start"], x[i,"length"];
print RSTART, RLENGTH; print RSTART, RLENGTH;
* ------------------------------------ * ------------------------------------
str::match(@b"ab\xB0\x98cdefgdefx", /(def)g(.+)/, 1, x); str::match(@b"ab\xB0\x98cdefgdefx", /(def)g(.+)/, 1, x);
q = length(x) / 2; q = length(x) / 3;
for (i = 1; i <= q; i++) print x[i,"start"], x[i,"length"]; for (i = 1; i < q; i++) print x[i,"start"], x[i,"length"];
print RSTART, RLENGTH; print RSTART, RLENGTH;
*/ */
return __fnc_match(rtx, fi, 1); return __fnc_match(rtx, fi, 1);