Regular Expression to find the first character [Resolved]

Posted by Thiru under Others on 9/20/2011 | Points: 10 | Views : 1126 | Status : [Member] | Replies : 2
Hi,

About Regular Exp.
my reg.exp for mobile number is: /^[0-9]{10}$/;

i like to add additional condition along with this.
condition is: First number should be greater than 0

how to do?




Responses

Posted by: Blessyjees on: 9/21/2011 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Hi,

Try this reg.exp ^[1-9]?[0-9]{9}$

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thiru on: 9/21/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks Blessy
Its working fine.

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response