Application of regular expression


1. Balanced group / recursive matching
(?’ Group ‘), which is called the corresponding content of group, and counts it on the stack;
(?’- Group ‘), and count the corresponding content named group out of the stack
(?!) Zero width negative look ahead assertion. Since there is no suffix expression, attempts to match always fail
Regular example:
Test data:
Comparison results: “1”: [“1”, “1-1”, “1-2”],

Comment: This is very good. It can achieve the effect of taking out the nearest one

2. Zero width assertion
(?= Exp) matches the position in front of exp
(?<= Exp) matches the position after exp
(?! Exp) is not followed by the location of exp
(?<! Exp) matches the position not in front of exp
Regular example:

Test data:
<li>Update record < a</a></li>

The comparison results were as follows: the records were updated in the following way</a>

Comment: This is very good. You can take the beginning and end, but you can’t see < a >… < / a > in < a >… < / a > again. Fortunately, hmtl doesn’t let < a > appear in < a > again. If it’s like div, you have to write it like this.


< div > AAA < div > other available testing tools: < / div > BBBB < / div > < div > < a