可能重复:
正则表达式中的Tilde运算符
echo preg_replace_callback('~-([a-z])~', function ($match) {
return strtoupper($match[1]);
}, 'hello-world');
Run Code Online (Sandbox Code Playgroud)
代码来自http://php.net/manual/en/functions.anonymous.php
我搜索了正则表达式中的"〜"并没有找到答案.
它有什么作用?