For clarification:
The goal of the code is to find where the extra phone message text begins (it's added by verizon) and delete from there to end of file (replace with ''). But there is going to be some users message of value before that, then followed by a rather long advertisment, links, etc. The message that needs deleted begins (but continues on for 6 long sentences) with:
This message was sent using the Picture and Video Messaging service from Verizon Wireless!
The code below works but starts when finding the word 'This'. But I'd like to be more specific and insist it find more such as 'This message was sent' because it's possible for the user message to contain the word 'This'.
When I attempt to update the code below with more that just 'This', it stops working. (no text is removed)
Running code:
//-------------------- Clean up Caption for Verizon -------------------------------
$clipuscaption = preg_replace('/(?<=This)\b.*/is','', $uscaption);
unsuccessful alterations:
//-------------------- Clean up Caption for Verizon -------------------------------
$clipuscaption = preg_replace('/(?<='This message was')\b.*/is','', $uscaption);
unsuccessful alteration 2:
//-------------------- Clean up Caption for Verizon -------------------------------
$clipuscaption = preg_replace('/(?<=This message was)\b.*/is','', $uscaption);
Thanks!