如何匹配文本周围的所有符号


How to match all symbols around the text

$text = '2434__(this is something)-__2345';
 preg_match('/['p{Latin}]+/u', text, $matches);

在这里,我只得到文本的匹配,但是如何匹配文本中存在或不存在的所有符号?

这将匹配所有符号:

$match = $text

我希望你能理解你想要的。

preg_match('/^([^'p{Latin}]+)(['p{Latin}'s]*)([^'p{Latin}]+)$/u', $text, $matches);
print_r($matches);