What I have is:
Code: Select all
$oldContent = readfile("$testFile");
$newContent = regexreplace($oldContent, "^([0-9a-zA-Z_.#\-]*[a-zA-Z0-9]{3}[0-9]{3}~[0-9a-z\-]*\.[a-z]*)(.*)$", $1);
$newContent = regexreplace("$newContent", "\s|\S*", ""); // I cannot get this to completely delete the first line for the text to be written
writefile("$testFile", $newContent);