Boundary matchers and groups
The above points have taken up a lot of space. Now we will introduce some concepts of boundary matching characters and groups.
The general boundary matching characters are as follows:
Syntax | Description |
^ | Matches the beginning of the string (matches the beginning of each line in the case of multiple lines) |
$ | Matches the end of the string (matches the end of each line in the case of multiple lines) |
\A | Matches only The beginning of the string |
\Z | matches only the end of the string |
\b | matches \w and \W |
\B | [^\b] |
There should be examples here, but considering the space issue, I won’t post them