我想要处理iOS内部名称。我想在JS中检查const type是否等于以下任何一个
"iPhone10,3", "iPhone10,6", "iPhone11,2", "iPhone11,4", "iPhone11,8"。
我想用最短的方式来表达这一点,但它有点复杂。
是
type.match(/^iPhone(10\,[36]|11\,\d)$/)最短的?
发布于 2018-09-22 15:20:25
如果您希望仅允许这5个特定的可能值,则还应限制iPhone 11的子版本:
^iPhone(10,[36]|11,[248])$https://stackoverflow.com/questions/52454344
复制相似问题