Regular Expression in .NET Examples

I will try to guide you step by step on how to write our own regular expression. The purpose of this article is Easily create and understand regular expressions. This will helpful, when we create an application.

Examples of regular expressions

Example No.1



Example: 289

Description: A Three digit number

Example No.2



Example: Christopher

Description: At least eight character. But not more than twenty characters.

Example No.3



Example: 10-3944

Description: Two Digit number followed by a hyphen and a four-digit number.

Example No.4



Example: Sample.jpg

Description: Up to eight letters or numbers,followed by a period and up to three letters or numbers

Example No.5



Example: SB-1234

Description: The letters AB or SB, followed by a hyphen and a 1 to 5 digit number .

Example No.6



Example: 93711-2767

Description: A Five digit number,optionally followed by a hyphen and four digit number.

Example No.7



Example: arm02

Description: A text entry that contains at least numeral.

Example No.8



Example: x023

Description: The letter x,y, or z followed by a 3 digit number.


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: