- 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 - Quantifiers
Quantifiers specify how many instances of the previous element (which can be a character, a group, or a character class) must be present in the input string for a match to occur.
Quantifier | Description | Pattern | Matches |
---|---|---|---|
* | Matches the previous element zero or more times. | \d*\.\d | ".0", "19.9", "219.9" |
+ | Matches the previous element one or more times. | "be+" | "bee" in "been", "be" in "bent" |
? | Matches the previous element zero or one time. | "rai?n" | "ran", "rain" |
{ n } | Matches the previous element exactly n times. | ",\d{3}" | ",043" in "1,043.6", ",876", ",543", and ",210" in "9,876,543,210" |
{ n ,} | Matches the previous element at least n times. | "\d{2,}" | "166", "29", "1930" |
{ n , m } | Matches the previous element at least n times, but no more than m times. | "\d{3,5}" | "166", "17668" "19302" in "193024" |
*? | Matches the previous element zero or more times, but as few times as possible. | \d*?\.\d | ".0", "19.9", "219.9" |
+? | Matches the previous element one or more times, but as few times as possible. | "be+?" | "be" in "been", "be" in "bent" |
?? | Matches the previous element zero or one time, but as few times as possible. | "rai??n" | "ran", "rain" |
{ n }? | Matches the preceding element exactly n times. | ",\d{3}?" | ",043" in "1,043.6", ",876", ",543", and ",210" in "9,876,543,210" |
{ n ,}? | Matches the previous element at least n times, but as few times as possible. | "\d{2,}?" | "166", "29", "1930" |
{ n , m }? | Matches the previous element between n and m times, but as few times as possible. | "\d{3,5}?" | "166", "17668" "193", "024" in "193024" |
vb.net_regular_expressions.htm
Advertisements