Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用正则表达式计算 i18n 项目的参数数量,如下所示
new Regex("\\{.*?\\}").findAllIn("{1},{2},{3} '{'4'}'").length
应该返回 3 而不是 4。有人可以帮助我的正则表达式吗?
如果参数只能包含数字,请将模式替换为以下模式:
\\{\\d+\\}