katursis / pawn.regex Goto Github PK
View Code? Open in Web Editor NEW๐ Plugin that adds support for regular expressions in Pawn
License: MIT License
๐ Plugin that adds support for regular expressions in Pawn
License: MIT License
Hello!,
how can I evade this issue? It is a correct regex.
error 027: invalid character constant
Line: ReplaceString(info, "\{[0-9A-F]{6}\}", " ", infoa);
Best regards and thanks for your time.
This is my code:
public OnPlayerText(playerid, text[])
{
new Regex:r = Regex_New("\b(word1|word2|word3)\b", REGEX_ICASE),
RegexMatch:m,
startpos, pos;
if(Regex_Search(text, r, m, pos, startpos))
{
SendClientMessage(playerid, 0xF154ACFF, "Detected");
return 0;
}
Regex_Delete(r);
return 1;
}
This is how it should work:
https://i.imgur.com/wtbb9Wi.png
When I type word1 or word2 or word3 ingame, nothing happens. But, when I remove '\b' from regex pattern it works, but not the way I want. Without using '\b' it will capture word even if it's mixed within another word.
Like this:
#define PAWNREGEX_INCLUDE_VERSION 112
It would not work with windows plugin version as 112 but it would work as #define PAWNREGEX_INCLUDE_VERSION 111
I have tried building the latest files in both windows and linux but no effect in windows while its working with linux.
And this goes opposite for linux. If its 112 then its fine and if its 111 then it dosent.
Most of SA:MP (core, libraries, and plugins) are written as:
Library_FunctionName
, but this for some reason ignores that and uses library_function_name
. Can this be corrected to better match all other code?
stock ReplaceString(const str[], const regexp[], const fmt[], dest[], size = sizeof dest)
{
new Regex:r = Regex_New(regexp);
if (r)
{
Regex_Replace(str, r, fmt, dest, MATCH_DEFAULT, size);
Regex_Delete(r);
}
}
main()
{
new str[128];
ReplaceString("Pawn. CMD", " ", "", str);
printf("%s", str);
}
Error: [Pawn.Regex] Plugin::n_regex_replace: invalid str or fmt
this error suddenly appeared on my console logs.... [Pawn.Regex] Plugin::n_regex_search: invalid regex handle
please some info as i don't have any information!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.