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.
() [] {}这些是有效匹配但({)}为假,例如:
()
[]
{}
({)}
() - true ()[]- true ()[]{} - ture ([]) - false (){[}] - false.
我可以使用正则表达式来计算吗?
不,正则表达式的已知限制之一是它无法判断括号是否格式正确。