SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/01/2013, 07:47 PM   #1
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,050
Reputation: 205
Default [REGEX] Acceptable nickname regular expression

Hi,

I'm programming some user interface in PHP, and I'm having a little problem with acceptable nicknames.

I know these are the accepted characters:
a-z A-Z 0-9 . _ $ @ = ( ) [ ].

and you need 3-20 characters. (can be done with strlen)

Does anyone have a regular expression laying around or knows how to make a regex for checking if any other characters than those allowed are posted($username)?
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 29/01/2013, 08:13 PM   #2
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,093
Reputation: 2655
Default Re: [REGEX] Acceptable nickname regular expression

Not too good with regex, but I think it's basically just this:

Code:
^[A-Za-z0-9\._\$@=\(\)\[\]]+$
__________________
Vince 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
[Plugin] Regular expression Fro1sha Plugin Development 124 16/02/2019 01:18 PM
Little Help With RegEx [AU]Ownage Scripting Help 2 14/01/2013 03:30 PM
regex dafuq Scripting Help 4 23/09/2012 05:14 PM
Regular Expression Zh3r0 Everything and Nothing 4 18/08/2011 04:28 AM
PHP -> RegEx help *IsBack Everything and Nothing 0 25/06/2011 04:02 PM


All times are GMT. The time now is 08:08 PM.


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