-9

I am new to javascript. i would like build a regular expression for "IN12345678" (i.e., starts with IN and ends with eight digit, totally 10). i was bit confused by creating this expression. kindly help me solve this...

KP Naik
  • 11
  • 1
    Welcome to Stack Overflow! Please take the [tour], look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) Read through reference material and tutorials on regular expressions, and try to do the work. **If** you run into a *specific* problem, post your code and a description of the problem you're having (after doing research and [searching](/help/searching), of course), and people will be glad to help. – T.J. Crowder May 09 '17 at 05:45
  • 1
    this is something that should be easily learnt by reading regex tutorials – A. L May 09 '17 at 05:45

2 Answers2

2

Check if this regex helps ^IN\d{8}$

ajinkya narkar
  • 394
  • 1
  • 4
1

This regex works for your case

/^IN[0-9]{8}$/
Jins Peter
  • 2,147
  • 1
  • 16
  • 33