I'm facing a very strange error with regex in php.
My Pattern is
/\[B\]\[SIZE=3\](Trama|Recensione:|Curiosità|Trama:)\[\/SIZE\]\[\/B\](.*?)\[B\]\[SIZE=3\]/is
And it works with "Trama", "Recensione:", and "Trama:", but not with "Curiosità" in my script. The strange thing is that if i type this pattern here, it matches all correctly. What am I doing wrong?
My script:
$query = $db->query("SELECT `t`.`threadid`, `t`.`title`, `t`.`firstpostid`, `t`.`dateline`, `f`.`parentid` FROM {$db->tabelle['topic']} AS t, {$db->tabelle['forum']} AS f WHERE `f`.`forumid` = `t`.`forumid` AND `f`.`parentid` = ". (SEZIONE_RECENSIONI) ." AND `visible` = 1 ORDER BY `dateline` DESC LIMIT 10");
while($thread = $db->fetch_array($query))
{
$post = $db->fetch_array($db->query("SELECT `pagetext`, `userid` FROM {$db->tabelle['post']} WHERE `postid` = {$thread['firstpostid']}"));
$pattern = "/\[cover\](.*?)\[\/cover\]/is";
preg_match($pattern, $post['pagetext'], $cover);
$pattern = '/\[B\]\[SIZE=3\](Trama|Recensione:|Curiosità|Trama:)\[\/SIZE\]\[\/B\](.*?)\[B\]\[SIZE=3\]/isU';
preg_match($pattern, $post['pagetext'], $trama);
$content = remove_bbcode($parser->parse(truncate(utf8_encode($trama[2]), 350, '...', false, true)));
$page .= "<li>
<div class=\"recensione\" style=\"background: url(".$cover[1].") no-repeat; background-size: cover; background-position: 20% center; \">
<p class=\"recensione_titolo\"><a href=\"?rec={$thread['threadid']}\">{$thread['title']}</a></p>
<p class=\"recensione_content\">{$content} <a href=\"?rec={$thread['threadid']}\"><em>Continua a leggere</em></a></p>
</div>
</li>";
}
/Uflag to make it/isU