- 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 - Alternation Constructs
Alternation constructs modify a regular expression to enable either/or matching. The following table lists the alternation constructs −
Alternation construct | Description | Pattern | Matches |
---|---|---|---|
| | Matches any one element separated by the vertical bar (|) character. | th(e|is|at) | "the", "this" in "this is the day. " |
(?( expression )yes | no ) | Matches yes if expression matches; otherwise, matches the optional no part. Expression is interpreted as a zero-width assertion. | (?(A)A\d{2}\b|\b\d{3}\b) | "A10", "910" in "A10 C103 910" |
(?( name )yes | no ) | Matches yes if the named capture name has a match; otherwise, matches the optional no. | (?< quoted>")?(?(quoted).+?"|\S+\s) | Dogs.jpg, "Yiska playing.jpg" in "Dogs.jpg "Yiska playing.jpg"" |
vb.net_regular_expressions.htm
Advertisements