- VB.Net Basic Tutorial
- VB.Net - Home
- VB.Net - Overview
- VB.Net - Environment Setup
- VB.Net - Program Structure
- VB.Net - Basic Syntax
- VB.Net - Data Types
- VB.Net - Variables
- VB.Net - Constants
- VB.Net - Modifiers
- VB.Net - Statements
- VB.Net - Directives
- VB.Net - Operators
- VB.Net - Decision Making
- VB.Net - Loops
- VB.Net - Strings
- VB.Net - Date & Time
- VB.Net - Arrays
- VB.Net - Collections
- VB.Net - Functions
- VB.Net - Subs
- VB.Net - Classes & Objects
- VB.Net - Exception Handling
- VB.Net - File Handling
- VB.Net - Basic Controls
- VB.Net - Dialog Boxes
- VB.Net - Advanced Forms
- VB.Net - Event Handling
- VB.Net Advanced Tutorial
- VB.Net - Regular Expressions
- VB.Net - Database Access
- VB.Net - Excel Sheet
- VB.Net - Send Email
- VB.Net - XML Processing
- VB.Net - Web Programming
- VB.Net Useful Resources
- VB.Net - Quick Guide
- VB.Net - Useful Resources
- VB.Net - Discussion
VB.Net - Anchors
Anchors allow a match to succeed or fail depending on the current position in the string. The following table lists the anchors −
Assertion | Description | Pattern | Matches |
---|---|---|---|
^ | The match must start at the beginning of the string or line. | ^\d{3} | "567" in "567-777-" |
$ | The match must occur at the end of the string or before \n at the end of the line or string. | -\d{4}$ | "-2012" in "8-12-2012" |
\A | The match must occur at the start of the string. | \A\w{3} | "Code" in "Code-007-" |
\Z | The match must occur at the end of the string or before \n at the end of the string. | -\d{3}\Z | "-007" in "Bond-901-007" |
\z | The match must occur at the end of the string. | -\d{3}\z | "-333" in "-901-333" |
\G | The match must occur at the point, where the previous match ended. | \\G\(\d\) | "(1)", "(3)", "(5)" in "(1)(3)(5)[7](9)" |
\b | The match must occur on a boundary between a \w (alphanumeric) and a \W (non-alphanumeric) character. | \w | "R", "o", "m" and "1" in "Room#1" |
\B | The match must not occur on a \b boundary. | \Bend\w*\b | "ends", "ender" in "end sends endure lender" |
vb.net_regular_expressions.htm
Advertisements