Regular expression matching a character string containing no line

Reference: https://www.cnblogs.com/wangqiguo/archive/2012/05/08/2486548.html

Use ^ (?!. The HelloWorld). $ Regex we will first. * Moved to the inside of zero width assertions.

First of all matching rows behind the first position, and then followed by the first match back row position, requirements for this position when the match is not * string helloworld match, it plainly can not claim back this position is similar to the character xxxxxxxxxxxxxxxxxxhelloworld string, thus eliminating the first line starts from the back of the case containing the helloworld.

Using regular expressions: ^ (?!. The HelloWorld). $

Guess you like

Origin www.cnblogs.com/jmliao/p/11775938.html