[英]Regex to match chars at the start and digits at the end
I need a regular expression for the following conditions: 对于以下情况,我需要一个正则表达式:
Examples: 例子:
Actually I have the following regex: 实际上,我有以下正则表达式:
(?!PAK)([A-Z]{1,4}[A-Z0-9]{7})$
The problem with this regex is, that "ABCDE123" is a match. 此正则表达式的问题在于,“ ABCDE123”是一个匹配项。
How can I say, that the first 1 to 4 characters are only upper case chars and the remaining (until the total lenght of 8) are digits? 我怎么能说前1到4个字符只是大写字符,其余(直到8个字符)是数字?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.