Outline:
- grammar
- Real
First, grammar
- (?<=pattern)pattern
- (?<!pattern) pattern
- pattern(?=pattern)
- pattern(?!pattern)
There are four models of zero assertion syntax, all consists of two parts consisting of regular, matching the red part of the real content.
Second, combat
Text: Youth do not know worry about the taste, as Fu poetry that worry .
This paper has two unhappy words, you can take advantage of zero models assertion, find one of them according to the rules.
- test1: find does not know the back of the melancholy words
The first method directly to not know behind melancholy words
(? <= Do not know) worry
The second method, to find non- keung said the back of the unhappy word
(? <! Keung said) worry
- test2: find the taste of the previous unhappy
The first method, directly to the taste of the previous unhappy
Worry (? = Taste)
The second method, to find non . Front worry
worry(?!.)