I need regular expresion for number upto 12 in length with ( - ) after 4 digits and starting with zero only kindly help me out
Asked
Active
Viewed 96 times
1 Answers
0
/0\d{3}\-\d{7}/
this will match for exactly 12 length
read documentations and learn regex , its very useful
according to the comment if you want a regex which allows upto
12 , then
/0\d{3}\-\d{1,7}/

aelor
- 10,892
- 3
- 32
- 48
-
and why is this downvote for ? – aelor Mar 17 '14 at 08:40
-
According to the OPs text, `0123-4` would also be valid input, but your regex doesn't allow that. (Downvote not from me, BTW). – DarkDust Mar 17 '14 at 08:40