I am modifying a WordPress plug-in that needs to be intercepted from the source code of the web page generated by WordPress. However, there are occasional cases of backslash + number in the source code, and the matching result is abnormal, and the backslash and the following two digits will be swallowed in the result.
<?php
header("Content-type: text/html; charset=UTF8");
// demo ""
$str="
<div class=\"post_t\">
\f
\1
\9999
<div></div>
</div>";
$regexp="/\"post_t\".*<div/s";
preg_match($regexp, $str ,$match);
echo $match[0];
// :
// \f \f
// \1
// \9999 99
I am puzzled. Even if the backslash is treated as some other base, it should not be swallowed. I do not know if you have encountered this situation, do you have any experience, thank you!