Search this blog

You can search for all the topics in our blog using our google custom search now.

Search the blog

Loading

Sunday, July 4, 2010

Learning regular expression step by step tutorials: Step 4


Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs and Interviews



DOT META CHARACTER
In Regular expressions, DOT or PERIOD meta character which is used most commonly. Dot meta character will match with any single character, not checking what character it is except for any new line characters(\n).

The dot will match with anything which is very convenient at the beginning when you test our regular expression with valid input. The drawback is: again dot will match with anything and give us wrong matches.

For example:

Imagine we need to check if a given number is a valid phone number. To do that we can form a regular expression like this:

\d\d\d.\d\d\d.\d\d\d\d

The reason i have given a dot is because the user might enter a phone number like this: 408 512 3625 , 408-512-6589 etc etc.

The above regular expressions works nicely for  above two formats. How ever it also matches for 408551293625,408/512/3625 etc etc.

So use it carefully.

Regards





Related Topics Links

Step 1 Learning regular expressions,


Step 2 Learning regular expressions


Step 3 Learning regular expressions
Sameer Shaik


 Video Links will be posted soon
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs and Interviews
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.

No comments:

Post a Comment