现在有个XML类似:
<aaa> <bbb> <ccc> 1|+|2|+|3|+|4 5 6|+|7 </ccc> </bbb> </aaa>
我想找出两个|+|中间的内容里的换行,也就是4后边的一个换行,5后边的一个换行,正则能实现么?
走同样的路,发现不同的人生
In this case you need to match twice, the first time两个|+|中间的内容
两个|+|中间的内容
\|\+\|[\s\S]+?\|\+\|
The matching result is:
[1]:|+|2|+| [2]:|+|4 5 6|+|
Then perform a second match separately:
\w\n
The result is
共找到 2 处匹配: 4 5
In this case you need to match twice, the first time
两个|+|中间的内容
The matching result is:
Then perform a second match separately:
The result is