Regular Expression block negation
I want to find out a string in which a particular tag does not occur, such as:
<xyz>[w]+<[^(unwanted)]></xyz>
where unwanted
will be interpreted as a
, d
, e
, n
, t
and u
. But what I want is a block string. How can I express it in regular expression? I have tried negative lookahead, which doesn't work:
<xyz>.+(?!unwanted).+</xyz>
<xyz>(?:(?!unwanted).)+</xyz>
匹配<xyz>...</xyz>
所有字符,但只限于unwanted
的表达式不在任何字符处开始。
上一篇: 只匹配一个字或连字符
下一篇: 正则表达式块否定