[Plugin] Regular expression
#41

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
Would check only for _ or letters too?
One _

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
TesT_TeST would return 1 or 0?
Return 0

And you can check it yourself using this is plugin.
Reply
#42

Example please, that player would connect with this form: Firstname_Secondname

example: Yes_Yes

but not YeS_yES
Reply
#43

Quote:
Originally Posted by BaubaS
Посмотреть сообщение
Example please, that player would connect with this form: Firstname_Secondname

example: Yes_Yes

but not YeS_yES
http://www.regular-expressions.info/refadv.html

regEx is reading many many tutorials before you can get started with it..
Reply
#44

This is a great plugin..
I'll use it
Reply
#45

Quote:
Originally Posted by gamer_Z
Посмотреть сообщение
http://www.regular-expressions.info/refadv.html

regEx is reading many many tutorials before you can get started with it..
I can't get it, oh god, example please, then I will get something.. )
Reply
#46

Read the whole topic ****** gave some and some other people too.
Reply
#47

pawn Code:
CWeb = regex_build(\"((http://)|(https://))?([a-zA-Z0-9]+[.])+[a-zA-Z]{2,4}(:\d+)?(/[~_.\-a-zA-Z0-9=&%@:]+)*\??[~_.\-a-zA-Z0-9=&%@:]*)");
Should work (I think).
Reply
#48

Edit: this one is giving invalid character constant now

pawn Code:
stock ContainsIPEx(const string[])
{
    static RegEx:rCIP;
    if ( !rCIP )
    {
        rCIP = regex_build("(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9])");
    }
    return regex_match_exid(string, rCIP);
}
Reply
#49

It's because you don't escape your backslashes, i.e.:
pawn Code:
printf("\.");
Is wrong.

Correct way:
pawn Code:
printf("\\.");
OR, if you don't want to escape all backslashes, you can do:
pawn Code:
printf(\"\.");
Note that you won't be able to use newline characters and such (\n).
Reply
#50

The user on the other page gave me the code.. I just put the \" like what you did in ContainsWebsite for now
Reply
#51

Sorry to say, none of your versions work, they can the server when the stock is called
Reply
#52

God bless you, thanks a LOT!
Reply
#53

Thanks man u deserve 200+ rep at least
Reply
#54

it doesnt work on 0.3d?
Reply
#55

it work on 0.3d. I have it on my server. It works fine.
Reply
#56

on my 0.3d server doesnt works, why? i have downloaded the the vesion 0.2.1, but it didnt work.
Reply
#57

Quote:
Originally Posted by bryanwilgner
View Post
on my 0.3d server doesnt works, why? i have downloaded the the vesion 0.2.1, but it didnt work.
It doesn't work either for me on my 0.3d R2 server.

Every time I do a gmx or exit, I have the same problem:

Quote:
Originally Posted by Slice
View Post
Code:
samp03svr: ./boost/smart_ptr/intrusive_ptr.hpp:166: T* boost::intrusive_ptr<T
>::operator->() const [with T = RegularExpression]: Assertion `px != 0' failed.
Aborted
:/

Crashes the server every time I do a gmx.
Reply
#58

very very nice Plugin
Reply
#59

What is that, I'd like to learn more about it.. I read Wikipedia but understood nothing.. I'd like to know how it's being used too.
Reply
#60

Code:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@=_[].()$
All characters for a valid SA-MP name for anyone that has a "/changename" command!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)