Jump to content

Regular Expressions to validate data


progwihz@yahoo.com

Recommended Posts

Hi all, am trying to implement some regex functions for data validation. As it’s quite confusing (for me at least) I’ve decided to layout what I am trying to achieve below.  I’ve got several senarios that I am trying to generate regex to accomplish.

 

 

1. validate string data (allow alpha num  _- +) no spaces allowed

2. validate string data (allow alpha, num _ - + &) no spaces allowed

3. validate string data (allow num only with max length of 2) no spaces allowed

4 validate data (allow num only) any length

 

 

many thanks

Link to comment
https://forums.phpfreaks.com/topic/84304-regular-expressions-to-validate-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.