Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi anybody please help about this.
Posted
Updated 24-Apr-11 19:26pm
v2
Comments
Sandeep Mewara 25-Apr-11 2:09am    
No effort

Try
C++
^91[7-9][0-9]{8}$
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Apr-11 1:39am    
It works (but "8" might vary); I also added optional "+" (and referenced your answer).
Please see.
--SA
Abhinav S 25-Apr-11 1:48am    
Thanks for the 5. I went through your answer.
\+91[7-9][0-9]*


You can also make "+" optional:

\+?91[7-9][0-9]*


Combination with the feature shown by Abhinav will add constraints of start and end of line and number of digits (8 or any other):

^\+?91[7-9][0-9]{8}$


Or you can add optional blank space or "-". Do you need this as well? The idea is the same.

—SA
 
Share this answer
 
v4
Comments
Abhinav S 25-Apr-11 1:47am    
A complete answer. My 5.
Sergey Alexandrovich Kryukov 25-Apr-11 1:49am    
Thank you, Abhinav.
--SA
Prashant Srivastava LKO 12-Jan-12 0:44am    
Nice Answer my 5
Sergey Alexandrovich Kryukov 12-Jan-12 1:23am    
Thank you, Prashant.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900