Home  >  Article  >  Backend Development  >  php 正则中的 x2dx2ex5f 表示什么?

php 正则中的 x2dx2ex5f 表示什么?

WBOY
WBOYOriginal
2016-06-06 20:34:411243browse

preg_match("/^[\x{4e00}-\x{9fa5}A-Za-z0-9\x2d\x2e\x5f]+$/u", $name)

正则中 \x2d\x2e\x5f 表示哪些字符? 有没有一个完整的表可以参考?

回复内容:

preg_match("/^[\x{4e00}-\x{9fa5}A-Za-z0-9\x2d\x2e\x5f]+$/u", $name)

正则中 \x2d\x2e\x5f 表示哪些字符? 有没有一个完整的表可以参考?

<code>echo utf8_decode("\x2d\x2e\x5f");
</code>

其實就是 "-._"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_...

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