We have a line for example:
Описание работы 4 [gallery ids="781,780"] From here you need to get IDshniki
I am trying to get them using the following expression:
$ids = preg_replace('@.*\[gallery ids="([0-9,]+?)"]@m', '$1', $post->post_content);
In my understanding, it should be 781,780, but something went wrong ... I understand the problem in the line breaks, but I use the m flag. In general, who has the version, what's wrong? :)