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

简单正则解决办法

WBOY
Release: 2016-06-13 13:27:50
Original
950 people have browsed it

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

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

Related labels:
abc
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template