regex that checks if the string starts with two upper-case followed by numbers

孤街浪徒 提交于 2021-02-08 12:16:38

问题


Hi Guys I need a regex that checks if the string starts with two upper-case followed by numbers:

Example: DE123456789

Thanx a lot of.


回答1:


Literally:

^[A-Z]{2}\d+
  1. ^ - start of the string
  2. [A-Z] - an upper case letter
  3. {2} - two of those
  4. \d - a digit
  5. + - one or more of those


来源:https://stackoverflow.com/questions/32038690/regex-that-checks-if-the-string-starts-with-two-upper-case-followed-by-numbers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!