RegEx pattern any two letters followed by six numbers

前端 未结 5 1194
灰色年华
灰色年华 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:26

    Everything you need here can be found in this quickstart guide. A straightforward solution would be [A-Za-z][A-Za-z]\d\d\d\d\d\d or [A-Za-z]{2}\d{6}.

    If you want to accept only capital letters then replace [A-Za-z] with [A-Z].

提交回复
热议问题