使用 php preg_replace 从 utf-8 编码的字符串中删除一些标点符号

Using php preg_replace to remove some punctuations from utf-8 encoded string

我需要从字符串中删除除括号外的标点符号。我想出了以下内容:

$clean = preg_replace ( "/[^\.\,\-\_\'\"\@\?\!\:$ a-zA-Z0-9()]/", "", $maybedirty );

这似乎工作正常,直到我意识到我需要让一些 utf-8 编码的字符(东欧)通过。尽管我找到了许多可能解决方案的建议,但到目前为止我未能使它们起作用(或理解它们,或两者兼而有之)。所以问题是如何修改正则表达式以允许使用 utf-8 编码的字符。

$clean = preg_replace('/[^\w\s()]/', '', $maybedirty);

正则表达式解释:

[^\w\s()]

Match any single character NOT present in the list below «[^\w\s()]»
   A “word character” (Unicode; any letter or ideograph, any number, underscore) «\w»
   A “whitespace character” (any Unicode separator, tab, line feed, carriage return, vertical tab, form feed, next line) «\s»
   A single character from the list “()” «()»