-7

I need regular expresion for number upto 12 in length with ( - ) after 4 digits and starting with zero only kindly help me out

madi virgo_007
  • 21
  • 1
  • 4
  • 9

1 Answers1

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