<?php

    $file = '[trace-123] <request>This is a log line</request>
    [trace-124] <reply>This is another log line
    
    this is part of "[trace-124]" still.</reply>
    [trace-125] <request>final log line.</request>';
    
    $tracePattern = "/\[trace-[0-9]*+\]+\s*<(?:reply|request)>.*?<\/(?:reply|request)>/s";
    
    preg_match_all($tracePattern,$file,$lines);
    
    $lines = $lines[0]; // by defaults, $lines[0] will be an array of the matches, so get that
    
    echo "<pre>";print_r($lines);echo "</pre>";