Help with RegEx needed in PHP
I have this kind of strings...
---Quote (Originally by cyberpig)--- I thought is use hair dryer on the GPU? Put whole card in oven PCB won't melt meh? ---End Quote--- back in my old company, when we do such troubleshooting we usually use a blower/dryer meant for pcb components.
from those, I want to strip out all开发者_C百科 the text between ---Quote
and Quote---
, including them.
Kindly provide a PHP function please.
Thx
Try this:
$newText = preg_replace('/---Quote.*?---.*?---End Quote---/s', '', $oldText);
Tested on RegexPal.
preg_replace('/-{3}Quote(?:.\n)*-{3}End Quote-{3}/', '', $str);
Try this one:
preg_replace("#---Quote(.|\n)*Quote---#m", "", $str);
ReFiddle here.
精彩评论