28.07.2018, 03:32
Hello.
I'm learning a bit REGEX and I tried to use the regular expression I made on pawn by using Pawn.Regex plugin (made by YourShadow - https://sampforum.blast.hk/showthread.php?tid=609570) but nothing works.
There is my expression : https://regex101.com/r/FT3L4d/1/
Here is my code:
Maybe I misunderstood the usage of natives functions?
I'm learning a bit REGEX and I tried to use the regular expression I made on pawn by using Pawn.Regex plugin (made by YourShadow - https://sampforum.blast.hk/showthread.php?tid=609570) but nothing works.
There is my expression : https://regex101.com/r/FT3L4d/1/
Here is my code:
PHP Code:
main()
{
new
_result[500],
_result_length,
expr[] = "object CJ_BIG_SKIP1 (1)\" doublesided=\"false\" model=\"1365\" interior=\"0\" dimension=\"0\" posX=\"-2681.3000488281\" posY=\"865.29998779297\" posZ=\"76.400001525879\" rotX=\"0\" rotY=\"0\" rotZ=\"0\"";
new Regex:reg = Regex_New("[A-Z0-9_]*-?\\d+(.\\d+)?"),
RegexMatch:match;
if (Regex_Match(expr, reg, match))
{
Match_GetGroup(match, 1, _result, _result_length);
Match_Free(match);
}
printf("- '%s' - %i", _result, _result_length);
for(new i; i != _result_length; i++)
printf("- '%s'", _result[i]);
Regex_Delete(reg);
}