[英]python regular expression match a pattern
So, I have been trying to match a simple pattern like B0000001
where just the first character be an alphabet " B
" and rest should be numbers. 因此,我一直在尝试匹配一个简单的模式,例如
B0000001
,其中第一个字符是字母“ B
”,其余字符应该是数字。 The total length should be 9. 总长度应为9。
I tried the pattern "^B[0-9]{7}$"
but it fails most of the time. 我尝试了模式
"^B[0-9]{7}$"
但大多数情况下它失败。 Any suggestions? 有什么建议么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.