Try(尝试)
/{(.*?)}/
That means, match any character between { and }, but don't be greedy - match the shortest string which ends with } (the ? stops * being greedy).(这意味着,匹配{和}之间的任何字符,但不要贪婪-匹配以}结尾的最短字符串(?停止*为贪婪)。) The parentheses let you extract the matched portion.(括号使您可以提取匹配的部分。)
Another way would be(另一种方式是)
/{([^}]*)}/
This matches any character except a } char (another way of not being greedy)(这匹配除} char以外的任何字符(不贪婪的另一种方式)) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…