Why your regular expression takes the last occurrence of a substring and not the other?
Please help me. We need the regular season to write to choose what starts INSERT INTO then anything (including newline) and ends at the first occurrence of the ');' .
Here's what I made.
$result = preg_match_all("/INSERT INTO(.|\n|\r)*\)\;/i", $content, $inserts);
but it is not working. Choose from INSERT INTO to the last ');' , and it is necessary to first.
Thank you.
1 answer
Find more questions by tags ParsingPHPRegular expressions