从生成的文档替换time=32.7 word/s
时遇到很多麻烦。
此正则表达式(?s)time\=[0-9].*\/s
在崇高的文本中对我来说工作得很好,但我不知道如何通过PHP实现它。
我到底要你们什么?
所以我可以访问的所有文本文件都以time=(seconds)(space)word/s
结尾
请帮助我实现preg_replace以使用null(没有空格,什么都没有)过滤它
谢谢!
您应该查看preg_replace
的文档:https://www.php.net/manual/en/function.preg-replace.php
$text = 'lorem123time=32.7 word/s456ipsum';
print(preg_replace('/(?s)time\=[0-9].*\/s/','',$text)); //lorem123456ipsum