Git Product home page Git Product logo

pawn.regex's Introduction

Hi there ๐Ÿ‘‹

GitHub stats

pawn.regex's People

Contributors

dayvison avatar katursis avatar y-less avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pawn.regex's Issues

error 027: invalid character constant

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.

Word boundary (\b)

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:

https://i.imgur.com/1LdPxtl.png

Version issue with windows plugin

#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.

Ignores SA:MP naming conventions

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?

[Pawn.Regex] Plugin::n_regex_replace: invalid str or fmt

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.