我正在努力寻找正确的正则表达式返回:
'industry =[[Banking]], [[Financial services]] |products = [[Investment Banking]]'
来自以下内容:
<?php
$x = '[[Basel]] |key_people = [[Axel A. Weber]] (Chairman){{br}}[[Sergio
Ermotti]] (CEO) {{br}} |area_served = Worldwide |industry =[[Banking]],
[[Financial services]] |products = [[Investment Banking]]';
';
?>
使用preg_match
来修饰|
分隔文本的最后两部分
preg_match('~(?<='|)[^|]*'|[^|]*$~', $str);
演示