Examples of Boundary Matchers

Following are various examples of Boundary Matchers using regular expression in java.

Sr.NoConstruct & Matches
1^The beginning of a line.
2$The end of a line.
3\bA word boundary.
4\BA non-word boundary.
5\AThe beginning of the input.
6\GThe end of the previous match.
7\ZThe end of the input but for the final terminator, if any.
8\zThe end of the input.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *