RegEx pattern any two letters followed by six numbers

前端 未结 5 1191
灰色年华
灰色年华 2020-11-30 00:36

Please assist with the proper RegEx matching. Any 2 letters followed by any combination of 6 whole numbers.

These would be valid: 
RJ123456
PY654321
DD3212         


        
5条回答
  •  粉色の甜心
    2020-11-30 01:03

    [a-zA-Z]{2}\d{6}

    [a-zA-Z]{2} means two letters \d{6} means 6 digits

    If you want only uppercase letters, then:

    [A-Z]{2}\d{6}

提交回复
热议问题