faisal hameed wrote:Thanks for your response.
But how i can modify it so that it can accept only one dot(.) anywhere.
This is generally what happens with regular expressions -- when you try to get help from the net, but don't understand the code that you got. You wind up not being able to modify it, or even understand if it works or not.
You really need to start with a tutorial on regex, in order to understand it. Otherwise, you wind up using code that you don't understand, and that is *never* a good thing.
I feel that Regular expressions are something which are very useful to learn. I remember listening to one of the speakers at a local JUG meet about this book- Mastering Regular Expressions. Supposed to be really useful book.