Regular Expression Patterns

From various sources I have collected the following regular expression patterns. They helped me a lot in front-end and back-end validation.

Alpha:

Pattern: ^[a-zA-Z_ ]+$
Description: Allows only ‘A-Z’, ‘a-z’, space ( ‘ ‘ ) and underscore ( ‘_’).

Alphanumeric:

Pattern: ^[a-zA-Z0-9_ ]+$
Description: Allows only ‘A-Z’, ‘a-z’, ’0-9′, space ( ‘ ‘ ) and underscore ( ‘_’).

Email:

Pattern: /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

Numeric:

Pattern: ^\d+$

Decimal:

Pattern: ^\d+(?:\.\d{0,2})?$

Date – 1:

Pattern: ^(0[1-9]|[1,2][0-9]|3[0-1])-(0[1-9]|1[0,1,2])-\d{4}$
Description: Date format DD-MM-YYYY

Date – 2:

Pattern: ^(0[1-9]|1[0,1,2])-(0[1-9]|[1,2][0-9]|3[0-1])-\d{4}$
Description: Date format MM-DD-YYYY

US Zip Code:

Pattern: ^\d{5}$

US Telephone Number:

Pattern: ^1?[\-]?\(?\d{3}\)?[\-]?\d{3}[\-]?\d{4}$

Color Code:

Pattern: ^#{1}?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?$

Any HTML Tag:

Pattern: <([^">]+(?:”[^"]+”)*[^>]+)>

share save 120 16 Regular Expression Patterns

FS Snake & Lader 1.0

fs snk lad FS Snake & Lader 1.0

This game is based on a paper game, Snake and Ladder. You may have played this game before. I have added nothing more. I have just programmed it for my nephews and nieces. They give me the inspiration for designing and programming this game. Hope you will like it.

Click this link if you want to download it download FS Snake & Lader 1.0

share save 120 16 FS Snake & Lader 1.0

MSH Mini Puzzle Game 1.0

mshpuzz MSH Mini Puzzle Game 1.0

This is a puzzle game and it is freeware. You can freely distribute to your friends. It is mainly developed for children and for the beginners of computer operation. This will help them to improve their mouse movement. But anyone can play it and have fun. It is the first edition of the game. In this edition I have included 5 pictures’ puzzle. Hope you will enjoy the game.

To download a copy of the game click here download MSH Mini Puzzle Game 1.0

share save 120 16 MSH Mini Puzzle Game 1.0

MSH Relation Calculator – My First Software

mshrelcal MSH Relation Calculator   My First Software

This is my first software developed with Visual Basic in 2003. It is a fun software. It looks like Love Calculator, but has difference in result. It does not show percentage. It describes the relation. As I told before it is a fun software, it may not be true all the time. I shall not tell you anything more. You may try it and don’t forget to send your comment.

You can download a copy from here download MSH Relation Calculator   My First Software

share save 120 16 MSH Relation Calculator   My First Software

Database models – DatabaseAnswers

Many days ago I found a site that shows more than 500 data models. This site is run by Mr. Barry Williams. I found these models helpful for starting database design. And I think that anyone can learn professional database design from these models. Hope you will find something useful from this site.

So, before start designing a database visit this site. Who knows, your problem might have already been solved.

Site address: http://www.databaseanswers.org/data_models/

share save 120 16 Database models   DatabaseAnswers

Enabling cURL in XAMPP

By default cURL is disable in XAMPP installation. If you want to enable cURL of your XAMPP environment then uncomment the following line:

;extension=php_curl.dll

to

extension=php_curl.dll

in the C:\Program Files\xampp\apache\bin\php.ini file (assuming you have installed XAMPP in “C:\Program Files” folder).

If you plan to switch version of PHP in XAMPP you may made the change in following files (assuming you have installed XAMPP in “C:\Program Files” folder):

  • C:\Program Files\xampp\php\php5.ini
  • C:\Program Files\xampp\php\php.ini
  • C:\Program Files\xampp\php\php4\php.ini
  • C:\Program Files\xampp\php\php4\php4.ini
share save 120 16 Enabling cURL in XAMPP
blog