Consistent regexp escaping

This commit is contained in:
Adrien Crivelli 2020-06-28 17:34:32 +09:00 committed by GitHub
parent 360c8d8284
commit 2896e6ceb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ use PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf;
function replaceBody(string $html): string
{
$lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
$bodystring = '@<body>.*</body>@ms';
$bodystring = '~<body>.*</body>~ms';
$bodyrepl = <<<EOF
<body>
<h1>Serif</h1>

View File

@ -20,7 +20,7 @@ body {
EOF;
return preg_replace('@</head>@', "$newstyle</head>", $html);
return preg_replace('~</head>~', "$newstyle</head>", $html);
}
public function testSetAndReset(): void