Home  >  Article  >  Backend Development  >  看不动的正则表达式,该怎么处理

看不动的正则表达式,该怎么处理

WBOY
WBOYOriginal
2016-06-13 13:42:50966browse

看不动的正则表达式
$compileStr = preg_replace('$\r\n|\x9|\/\/$','', $compileStr);


这里面的 $\r\n|\x9|\/\/$ 是什么含义 哟

特别是那一个 |\x9|



------解决方案--------------------
| 就是 或者

\x9 就是16进制9的ascii字符
------解决方案--------------------
$\r\n|\x9|\/\/$

\r 回车
\n 换行
\x9 制表符 常写作 \t 就是 Tab 键
\/ 斜杠,转义符 \ 应不要。因为分界符已不是默认的 /,而是自定义的 $


| 逻辑运算符 或

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn