I've googled and googled, and look at dozens of other answers but can't find anything that address removed TWO lines that begin with one string, and end with another, so am not including "what i've tried" because the dozen or so patterns don't even come close.
We've extracted text form PDF files, and all the links within the result appear in the output as two lines like this:
[Link]
2017_07_11_RM_4b.pdf
They always start with [Link]
, and always end with .pdf
. They appear throughout the result, often many times in a row, then a block of text, and more links, and so on - as many as 200+ occurrences. I'm trying to get the block of text without the occurrences of these two-line strings with a preg_replace()
that presumably looks something like this:
$newtext = preg_replace("/^[Link]*$/", "", $text);
Any assistance is appreciated, thank you.