1653 comments
\b The boundary of a word is that there can only be one character ( w) on the left and right, such as n There are two characters in total. In fact, there are three positions: space, b, letter \B A non word boundary is not a character twice or both sides are characters. such as go , it looks like two characters, but it is actually three positions of letter, B, and letter ?= ?<= ?! ?<! -
Forward looking:
exp1( ?= Exp2) Find exp1 before exp2 -
Look back:
( ?<= Exp2) exp1 Find exp1 after exp2 -
Negative foresight:
exp1( ?! Exp2) Find exp1 that is not followed by exp2 -
Negative looking back:
( ?<! Exp2) Exp1 Find exp1 not preceded by exp2 -
?: Non capture grouping. Sometimes we need to represent a whole, but do not want it to occupy a member of the regular matching result, we can use this, for example, if we want to match a string foo You can write/(?: foo) {1,2} if the substring is once or twice, but you do not need to record this group/
About me
-
I come from a small city in the south. I have a quiet personality and hate going with the tide.