Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 12:37 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ]  Bookmark and Share
Author Message
 Post subject: Regular Expression
PostPosted: Mon Sep 07, 2009 12:23 pm 
Offline

Joined: Sun Jul 12, 2009 10:24 am
Posts: 4
Hello all,

I have a problem involving regular expression, i come from a web background and it seems alot easier to use regular expression in those languages. However, what im trying to do is validate a text field. The constraints are: only a-z, both upper and lower case and the value -. (as it can be a dash). Other characters such as ,.&, 123...9 are not allowed. Can anyone help with this.

sample code i am sort of using is: regEx.Pattern = "[a-zA-Z]$"

Can anyone shed some light on this.

Jac


Top
 Profile  
 
 Post subject: Re: Regular Expression
PostPosted: Sat Oct 17, 2009 2:37 pm 
Offline

Joined: Tue Oct 06, 2009 8:24 pm
Posts: 7
You can use the function IsNumeric which takes the string as parameter to discard the numeric values. But you will have to check the other symbolic characters one by one.

Also, you can store the values to be discarded into an array and check if anyone of the value is present in the string. This will be much more easier to validate a text string.

Hope this helps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley