5

This is a regex specific question..

I need a regex that can find a certain keyword.. Example ABCDE But it should not match if certain characters precede this keyword.. Example ]]

So... In a line like this, it should only match the bold part..

[[TestChannel]] ABCDE: this is a test ABCDE

EDIT: I have been trying things out here.. http://gskinner.com/RegExr/

So far what i have tried..

(!]])(ABCDE)
((!]])ABCDE)
(!]])!(ABCDE)
((!]])|ABCDE)

Solution: With help from the link Pshemo commented -> http://www.regular-expressions.info/lookaround.html#lookbehind

(?<!]])ABCDE
4

1 に答える 1

8
(?<!]])ABCDE

リンクをありがとうPshemo。

于 2012-11-10T10:13:54.880 に答える