目前我有#([A-Z]+)\>*(.*)#
正则表达式。这是它的工作原理:
URL>{B>{A>a}}
Array
(
[0] => URL>{B>{A>a}}
[1] => URL
[2] => {B>{A>a}}
)
我需要在捕获结束时创建一个可选的命名组,例如:
URL>{B>{A>a}}:value
Array
(
[0] => URL>{B>{A>a}}
[1] => URL
[2] => {B>{A>a}}
[name] => value
)
URL>{B>{A>a}}
Array
(
[0] => URL>{B>{A>a}}
[1] => URL
[2] => {B>{A>a}}
)
这该怎么做?