Home > Backend Development > PHP Tutorial > 这么写正则为啥呢

这么写正则为啥呢

WBOY
Release: 2016-06-13 12:06:56
Original
775 people have browsed it

这样写正则为啥呢
要匹配很多类似$trade[subject]
的串,
别人 说应该这样写:href="[^"]*"

但我是我理解这样写是对的href=[^"]*"
我的理解是:第一个必须是以"开头,所以用了[^"]这个正则,如果在其前再加上"那不是重复了吗?不知我的理解哪里不对呢
------解决思路----------------------
[^"] 表示双引号以外的字符,即不匹配双引号

Related labels:
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