如何使用正则表达式从字符串中获取“参数”列表


How get list of 'parameters' from string using regular expressions?

>我有参数如下的字符串

"你好,%{用户}。请给%{客户}一把刀"。

所以,拜托,我不熟悉正则表达式,我需要有 php 结构,它可以从字符串中获取参数列表。请帮帮我,希望你能。谢谢。

$str = "Hello, %{user}. Please, give %{client} a knife".
preg_match_all("/%'{(.*?)'}/", $str, $matches);
print_r($matches);