regexp - Regular Expressions Dr. Ralph D. Westfall March,...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Regular Expressions Dr. Ralph D. Westfall March, 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
RegEx Object what does it do? finds patterns in text specific strings (all characters identified) strings with "wild cards" (any character) strings with certain characters, not others how could it be used in VB.NET? validating inputs on an input form e.g., email addresses, telephone #s, etc.
Background image of page 2
Regular Expressions based on the idea of wild cards .e.g., dir s*.doc in DOS/Windows finds any .doc file starting with s, followed by any other character(s) find much more complicated patterns e.g., any one of a specified list of characters rather than just one or any e.g., any character except ones in a list
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Regular Expression Object put import statement at top of code, just below Option Strict on Imports System.Text.RegularExpressions create a regular expression object Dim reg as Regex reg = New Regex("[pattern]") need to create a Regex with a pattern (can't add one later)
Background image of page 4
VB.NET RegEx Special Characters . ba. finds bat, bal, bac period matches any single character ? bottles? finds bottle and bottles 0 or 1 of what is before ?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

regexp - Regular Expressions Dr. Ralph D. Westfall March,...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online