Visual Basic ASCII Codes Validations and Regex Validations – VB NET Tutorial



Visual Basic ASCII Codes Validations and Regex Validations – VB NET Tutorial

Visual Basic ASCII Codes Validations and Regex Validations - VB NET Tutorial

In this lesson we look at some specialised methods of Checking the Inputs which Users enter into Text Boxes on Screen Forms.

This involves checking the ASCII Code values of the individual characters as they are typed in,
as well as using Regex Pattern Matching for items like hyphenated Phone Numbers and Email Addresses.

This is a long 90 minute video which includes three Validation Lessons, which we suggest you do separately rather than in one big learning session.

The three separate validation techniques we cover in the video are as follows:

Lesson A – Key Press ASCII Codes Validation
(Video Section: 13:59 to 32:31)

Lesson B – Whole String ASCII Codes Validation
(Video Section: 32:14 TO 1:11:43)

Lesson C – Regex “VB Regular Expressions” Pattern Matching Validation.
(Video Section: 1:11:43 to 1:27:36)

There is one set of Resources available at the Download Link given below which covers all three Validation Lessons.

Use the Timeline Index below to skip to various Index points in the video if you need to.

00:00 Lesson Intro and Overview
05:12 Strings and Substrings Explanation and Examples
10:25 ASCII Codes – What they are and Why we use them

LESSON A – KEY PRESS ASCII CODES VALIDATION
(13:59 to 32:31)

13:59 Using the “KEY PRESS” event to do immediate checking
as the User types each character into a Text Box
16:05 How to Create the Key Press Event for a Text Box
17:54 Program Code and Testing for the Key Press Subroutine
21:52 Alternative Key Press Validation with TOOL TIP message
23:56 Program Code for Tool Tip Message for Validation Errors
28:06 Validating Key Press Number Values using ASCII Codes
19:18 Program Code for Number Digits Validation

LESSON B – WHOLE STRING ASCII CODES VALIDATIONS
(32:14 TO 1:11:43)

32:39 What is Whole String Validation – Detailed Explanation
39:59 Setting up the Screen Form for Customer ID
40:34 Program Code for the Customer ID Validation
43:22 Using the “Character Casing” Property to make Upper Case Letters
44:14 Using the “Max Length” Property to limit Customer ID to 11 Characters
45:47 Blank Text Box Program Crashing Problems
47:57 Fixing the Program Crashing Problem with Existence Checking
51:35 Checking that all 11 characters have been entered into Customer ID
52:18 Quick Review of “Existence”, “Type” and “Range” Validation Checking
53:59 Testing the Validations for Blanks, Character 1 value, and Length.
55:00 Checking that Characters 2 to 8 are Letters or Spaces (For Next Loop)
57:55 Pseudocode of the For Next Loop Checking to work out the Logic
1:01:57 Program Code for Loop Checking of Customer ID
1:03:35 Testing the Positions 1 to 7 Validation Checking
1:04:38 Final Check – 3 digit number ending on Customer ID
1:06:03 Testing the 3 Digit Ending Validation
1:06:39 Update Success Message for Passing all 5 Validations
1:09:59 Being careful when validating People’s Names

LESSON C – REGEX REGULAR EXPRESSIONS PATTERN MATCHING VALIDATIONS
(1:11:43 to 1:27:36)

1:11:32 Using a Regex Pattern to Validate a Phone Number
1:14:38 How to Code the Regex Pattern Matching
1:20:17 Using Regex Pattern Validation for Email Addresses
1:21:29 Adding an Email Text Box onto the Form
1:22:00 Regex Program Code for Validating Email Addresses
1:22:51 Testing the Email validation
1:25:29 VB and C# Microsoft Regular Expressions for Modifying and Replacing String Data

LESSON WRAP UP

1:27:36 Why we have to learn many Different Programming Languages
1:29:25 Downloadable Resources for this Lesson (PDF Guide and Word Doc Code)
1:30:13 Passy’s World of ICT Programming Course
1:30:36 Video Wrap Up and Outro

Visual Basic is a great beginner’s programming language which can be used for developing prototype applications which run program code behind screen forms.

This video will be useful for anyone learning Visual Basic, especially students doing VCE Computing or VCE Software Development high school courses in Australia.

You can download a Free PDF hard copy of this presentation, as well as an MS Word doc containing all of the Form Designs and Programming Code at the following link:
https://tinyurl.com/y4z8utzm

The Step By Step Word Document gives you all of the material including the Form Design and Program Code, which you can copy and paste from the Word document into your Visual Basic Project.

You can check out our full Programming Course at the following link:
http://passyworldofict.com/programming

We are planning to make a number of Programming Videos that will be a great course for people to learn how to program in Visual Basic and Python.

Like this video if you found it helpful.

Subscribe to our Channel to get notified of our weekly video updates.

Enjoy,
Passy