小编nis*_*asi的帖子

使用正则表达式从字符串返回第一个外部结果

我有以下字符串:

"{My {formatted {hi|hello}|formate{hi|hello} }  {option 1|option 2|option 3}}";
Run Code Online (Sandbox Code Playgroud)

我想在"{"和"}"括号之间找到结果.

结果也应来自外层,而不是{hi|hello}:

"My {formatted {hi|hello}|formate{hi|hello} }  {option 1|option 2|option 3}"
Run Code Online (Sandbox Code Playgroud)

php regex string

1
推荐指数
1
解决办法
118
查看次数

标签 统计

php ×1

regex ×1

string ×1