- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$lib_path = 'core/modules/statistics/statistics.js';
$re = '/(<script src=").*?(' . $lib_path . ').*?(">)/is';
$content = 'Some content
<script src="http://example.com/core/modules/statistics/statistics.js"></script>
Etc.';
var_dump(preg_match($re, $content));