我正在为SwiftLint创建自定义规则,检查 color
的拼写 . 我需要这个不区分大小写 .
我目前正在使用 regex: "([C|c]olour)"
进行匹配,但我想使用不区分大小写的修饰符 /i
. 我尝试了以下规则,但它不起作用:
custom_rules:
color_us_english:
regex: "(colour)/i"
message: "Use US English spelling to match Apple's API."
severity: warning
你如何在SwiftLint中使用修饰符?
1 回答
可能是不支持以下内容:
请试试:
看看这个example .