Home  >  Article  >  Backend Development  >  求一段正则替换.该如何处理

求一段正则替换.该如何处理

WBOY
WBOYOriginal
2016-06-13 13:33:29666browse

求一段正则替换..
A-1要删除的内容B-1
需要保留的内容
A-2要删除的内容B-2
需要保留的内容
A-4要删除的内容B-4
需要保留的内容
A-3要删除的内容B-3
需要保留的内容
A-8要删除的内容B-8
.
.
.
需要保留的内容
A-n要删除的内容B-n


其中 n = 正整数 ,内容里会包含html标签,也包含换行等等...
求大虾指教.

------解决方案--------------------
/A-\d.*?B-\d/

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn