我想使用PHP删除文档中的一些标签

How can I mass delete tags like these in a document using PHP preg_replace?

<text:alphabetical-index-mark-start text:id="IMark169843024"/>

The only thing that is different from one to another is the number after IMark.

Thank you!

This is something you can fine-tune to whatever you need. But in general terms you can do something like this:

$string = preg_replace('~<text:.*?>~', '', $string);

Demo

Or you can filter it all the way down with something like this:

$string = preg_replace('~<text:alphabetical-index-mark-start text:id="IMark\d{9}"/>~', '', $string);

Demo

Either way, it'll be pretty easy to strip these tags out.