SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 11/04/2011, 05:39 PM   #11
armyoftwo
Gangsta
 
armyoftwo's Avatar
 
Join Date: Nov 2009
Posts: 674
Reputation: 5
Default Re: Regular expression

Hi,
Can someone explain why this is needed and for what?
I've looked the wiki and didn't find anything that explains what is this ( or i can't properly understand ,because my english is not very good).
Can someone explain more simple?
__________________
- [INC] Multi language
armyoftwo is offline   Reply With Quote
Old 11/04/2011, 05:43 PM   #12
Stepashka
Godfather
 
Stepashka's Avatar
 
Join Date: Jul 2008
Location: near PC
Posts: 5,463
Reputation: 131
Default Re: Regular expression

Quote:
Originally Posted by armyoftwo View Post
Hi,
Can someone explain why this is needed and for what?
I've looked the wiki and didn't find anything that explains what is this ( or i can't properly understand ,because my english is not very good).
Can someone explain more simple?
http://en.wikipedia.org/wiki/Regular_expression
__________________
Клятва Страуструпа: "Я обязуюсь прилежно комментировать свой код, не использовать goto и следить за состоянием своих потоков и выделяемой памяти. Я обязуюсь не оставлять мусора в системе и избегать однобуквенных переменных. Ресет." © Куч
M&M GM
Status: ON HOLD

Stepashka is offline   Reply With Quote
Old 11/04/2011, 06:00 PM   #13
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,215
Reputation: 363
Default Re: Regular expression

Quote:
Originally Posted by armyoftwo View Post
Hi,
Can someone explain why this is needed and for what?
I've looked the wiki and didn't find anything that explains what is this ( or i can't properly understand ,because my english is not very good).
Can someone explain more simple?
I think the Wikipedia provides a fairly simple and easy to understand explanation of what it's used for, it could be used for verifying the format of an input, like shown above in an example it could check the format of an email or "roleplay name" to ensure that it is correct. For example I've used regular expressions in PHP before to gather specific information from an HTML page and put it in an array, so it got rid of a lot of un-needed work.
__________________
Releases:
[Includes]: [jBan] | [jBanLite]
[Plugins]: [FileManager] | [Execute]
[Applications]: [Remote Administrator *NEW] | [Script King] | [RCON GUI]
JaTochNietDan is offline   Reply With Quote
Old 11/04/2011, 06:31 PM   #14
Zh3r0
Godfather
 
Join Date: Mar 2008
Posts: 5,438
Reputation: 398
Default Re: Regular expression

I understood the major part of this, but except this {2,9}, what does it mean?
__________________
Zh3r0 is offline   Reply With Quote
Old 11/04/2011, 06:37 PM   #15
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 4,215
Reputation: 363
Default Re: Regular expression

Quote:
Originally Posted by Zh3r0 View Post
I understood the major part of this, but except this {2,9}, what does it mean?
It means having at least 2 of x and at most 9 of x. Where x is the preceding element in the expression.
__________________
Releases:
[Includes]: [jBan] | [jBanLite]
[Plugins]: [FileManager] | [Execute]
[Applications]: [Remote Administrator *NEW] | [Script King] | [RCON GUI]
JaTochNietDan is offline   Reply With Quote
Old 11/04/2011, 06:38 PM   #16
xxmitsu
Gangsta
 
Join Date: Feb 2009
Posts: 622
Reputation: 36
Default Re: Regular expression

AWSOME work! now we have regexp in pawn . I've been using this for a while in php, and linux awk scripting.


Quote:
Originally Posted by Zh3r0 View Post
I understood the major part of this, but except this {2,9}, what does it mean?
Matches between 2 and 9 characters. Will match as many as possible.

LE: JaTochNietDan Haven't seen you posted the answer before
__________________
aka xanto - Retired - Former eGaming.ro technical staff.
xxmitsu is offline   Reply With Quote
Old 11/04/2011, 06:57 PM   #17
nemesis-
Huge Clucker
 
Join Date: Sep 2009
Location: USA
Posts: 236
Reputation: 65
Default Re: Regular expression

Very nice. Thanks for the contribution.
nemesis- is offline   Reply With Quote
Old 11/04/2011, 08:01 PM   #18
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,768
Reputation: 24
Default Re: Regular expression

Great ! Finally
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline   Reply With Quote
Old 12/04/2011, 04:55 AM   #19
Fro1sha
Big Clucker
 
Fro1sha's Avatar
 
Join Date: Nov 2009
Posts: 168
Reputation: 32
Default Re: Regular expression

Thanks all!
__________________
[Plugin] MultiThread
[Plugin] GMT Timezone
[Plugin] Regular expression

Development any plugins, for the money.
Разработка любых плагинов за деньги.
Fro1sha is offline   Reply With Quote
Old 12/04/2011, 07:42 AM   #20
OwlCity
Huge Clucker
 
Join Date: Nov 2010
Posts: 239
Reputation: 4
Default Re: Regular expression

Awesome work, I have just to say: Thank you.
OwlCity is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map] Las Venturas Regular Day Flyfishes Maps 17 16/05/2011 05:53 PM
Skins and regular players Anthonyx3' Help Archive 12 08/08/2010 01:40 AM
Regular Players Club help! bpeterson Help Archive 12 26/02/2009 07:53 PM
Regular San Andreas? Jakalak General 8 01/01/2009 07:04 PM


All times are GMT. The time now is 05:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.