我在座右铭:
X-91-55-72-X-X-X-90-82-91X
I want to use perl regex to validate this string is valid. I want to check the following:
这些框架以干线(
-
)划定。 必须有10个框架。第1至9条必须不是罢工(例如<代码>X)或两个数字,最多不超过10。
框架10差别很大。 某些有效价值如下:
XXX
- Three strikesXX7
- Two strikes and a digit of 0 to 9X91
- A strike and two digits adding up to no more than 1090
- Two digits adding up to less than 1091X
- Two digits adding up to 10 and then a strike917
- Two digits adding up to 10 follow by a digit of 0-9
While I can write a crap-ton of code to test each scenario, I m sure there s probably one or two regular expressions that would validate the string. My brain simply can not wrap itself around a regex solution. Any help is appreciated.
下面的法典对插图中的有效特性进行了核实:
if (gs =~ /A[X,0-9,-]+z/ iii
我不知道如何确定框架。