CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Validating a form field using a Regular Expression

Print topic Send  topic

Author Message
dunechi1d

Posts: 23
Posted: 10/28/2006, 1:28 AM

Hi,

I’m trying to validate a form field using a Regular Expressions – the field should be able to contain any character, digit or under score. The expression I’m using is: [_a-zA-Z0-9].

The problem is that I don’t get an errors when using “bad” characters like & for example.

Please help.

Danny
View profile  Send private message
feha


Posts: 712
Posted: 10/28/2006, 3:12 PM

Use this :

  
/^[a-zA-Z_]*$/  

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
feha


Posts: 712
Posted: 10/28/2006, 3:13 PM

/^[a-zA-Z0-9_]*$/

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
dunechi1d

Posts: 23
Posted: 10/28/2006, 9:35 PM

Works great - Thanks feha !!!

Danny
View profile  Send private message
andreasfc

Posts: 26
Posted: 11/01/2006, 2:06 AM

I need some help on how to use regular expressions for setting up more than one criteria
Examples
abc1234
aab1234567
bbb1234567890
ccc1234
ccc12345
ccc123456

Can this be done with one regular expression?
Thanx
View profile  Send private message
feha


Posts: 712
Posted: 11/01/2006, 11:11 AM

http://regexlib.com/default.aspx
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.