Recently, the following regular expressions were studied, and a regular expression 30-minute introductory tutorial was read online.
Tutorial point here ~ 30 minutes to get started
Speaking in the balance group (?!) Assert that a certain match isunsuccessful ...
Thought for a long while do not understand .... I understand that (?!) Assert the ...
A (?! b) can match A to the right not B, that a (?!) It means matching a to the right.
Then I entered the Qwea found not match. It feels very strange ... Tangled up 2, 3 days ... Later found that I understand the wrong ....
The correct understanding should be a match to the right is not an empty string ... Empty strings exist everywhere, such as "ABC" has 4 empty strings, a front and back, C front and back. to a (?!) The understanding should be match A to the right is not an empty string, because the right side of a must have an empty string, so the match must fail. All four assertions have this feature.
(?!) and (? <!) Must have been a failure.
(?! =) and (? =) must be successful.
The meaning of this usage is that the regular expression can fail according to the situation. In the balance group, if some characters appear unequal, you can use this technique to force the match to fail .... Language is a little difficult to describe, put an example of it ... I think it's a good story.
Https://msdn.microsoft.com/zh-cn/library/bs2twtah (v=vs.110). aspx
It's almost like that.
Empty string Assertion