Home >Backend Development >PHP Tutorial >简单正则解决办法

简单正则解决办法

WBOY
WBOYOriginal
2016-06-13 10:27:27774browse

简单正则
如何写“不以某一字符串开头”的正则表达式?
如:匹配不以“abc”开头的字符串

------解决方案--------------------
$r = '/^[^abc].*$/';
------解决方案--------------------
/^(?!abc).*/

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