---
title: "Regular Expression"  
description: "In this article, I have described most important regular expression in our project. These described below with tile, expression and description."  
author: "AVADHESH PATEL"  
published: 2012-12-27  
updated: 2017-11-30  
canonical: https://www.mindstick.com/articles/1092/regular-expression  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# Regular Expression

In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370), I have described most important [regular expression](https://www.mindstick.com/forum/65/regular-expression) in our project. These described below with tile, expression and description.\

##### Name

Expression: ^([a-zA-Z]+(?:\.)?(?: [a-zA-Z]+(?:\.)?)*)$

Description: It takes only alphabets with single dot operator. Not take space at beginning. For example Mr. Jemsh Smith, Mark Bell etc.

##### Email

Expression: ^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$

Description: It validates [email address](https://www.mindstick.com/forum/159727/how-can-i-validate-an-email-address-in-javascript).

##### Alphanumeric Character

Expression: ^(?=.*\d)(?=.*[A-Za-z])[A-Za-z0-9]{1,10}$

Description: It takes combination of alphabets and numbers. Not allow [special character](https://www.mindstick.com/forum/119/special-character-remove-from-url-or-any-string) and white space in beginning.

##### Number

Expression: ^\d+$

Description: It allow entered only numbers. For example **2561**.

##### Integer

Expression: ^-{0,1}\d*\.{0,1}\d+$

Description: It allow entered to integer values. For example -998, -198.00, 1700.00.

##### ZIP Code (Indian)

Expression: ^([1-9])([0-9]){5}$

Description: It allows entering Indian postal zip code. Indian postal zip code has six digits. For example **320001**.

##### ZIP Code (US)

Expression: ^\d{5}(-\d{4})?$

Description: this expression [validate](https://www.mindstick.com/forum/1490/what-is-better-solution-for-validate-form-textboxs-value) for US based zip code.

##### Date (mm/dd/yyyy)

Expression: (0[1-9]|1[012])[ /](0[1-9]|[12][0-9]|3[01])[ /]([0-9]{4})

Description: Above expression take date in mm/dd/yyyy (month/date/year) format.

##### File Format (.doc, .docx, .pdf)

Expression: ^.+\.(([dD][oO][cC][xX])|([dD][oO][cC])|([pP][dD][fF])|([wW][pP][dD]))$

Description: This expression allows only .doc, .docx (for [ms word](https://www.mindstick.com/forum/23166/preview-ms-word-excel-powerpoint-document-in-browser)) and .pdf format.

##### Mobile Number (India)

Expression: ^[789]\d{9}$

Description: This expression allow to take 10 digit numeric vales, stating from 9,8,7 only.

##### Mobile Number (US)

Expression: ^(\(?[0-9]{3}\)?)?\-?[0-9]{3}\-?[0-9]{4}$

\

Description: This expression allows taking US format mobile number. For example 987-987-9876.

##### Password (Strongly Type)

Expression: ^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W)\S{6,15}$

\

Description: Above expression take minimum 6 digit and maximum 15 digit

\

[characters](https://answers.mindstick.com/qa/42112/who-is-the-originator-of-avengers-characters) in [textbox](https://www.mindstick.com/articles/320/textbox-control-in-vb-dot-net) with at least one Uppercase, one lowercase, one numeric

\

value and one special character.

\

---

Original Source: https://www.mindstick.com/articles/1092/regular-expression

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
