I am trying to handle the string which got letters, numbers, Chinese and some punctuations and left number, letters and Chinese only like below
raw string
a>b%%c##1@23测$$试??\\:.##,,??!!
result
abc123测试
for Chinese, preg_replace('/\P{Han}+/u', '', $text) works perfectly
测试 // result
and for number and letters, preg_replace('/[^0-9a-zA-Z]/', '', $text) works too.
abc123 // result
But how can I combine them?
why preg_replace('/[\P{Han}]|[0-9a-zA-Z]/u', '', $raw); doesn't work as expected?
Thanks a lot for anyone help!