这样写正则为啥呢
Jun 23, 2016 pm 01:48 PM 要匹配很多类似$trade[subject]
的串,
别人 说应该这样写:href="[^"]*"
但我是我理解这样写是对的href=[^"]*"
我的理解是:第一个必须是以"开头,所以用了[^"]这个正则,如果在其前再加上"那不是重复了吗?不知我的理解哪里不对呢
回复讨论(解决方案)
[^"] 表示双引号以外的字符,即不匹配双引号
[^"] 表示双引号以外的字符,即不匹配双引号
晕,我理解排除了,搞混乱了

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to match multiple words or strings using Golang regular expression?

How to replace a string starting with something with php regular expression

How to use regular expressions to remove Chinese characters in php

How to use regular matching to remove html tags in php

Sharing tips on using PHP regular expressions to implement Chinese replacement function

PHP uses regular expressions to verify whether the input data is a number

How to verify if a URL is HTTPS protocol using PHP regex

How to use regular replacement to fix Chinese in PHP
