Example: Checking for correct UK Postcode

Slides:



Advertisements
Similar presentations
Access Lesson 13 Programming in Access Microsoft Office 2010 Advanced Cable / Morrison 1.
Advertisements

Class Scope class Student { private: string id; string firstName, lastName; float gpa; public: void Read() { cin >> id >> firstName >> lastName >> gpa;
The Substitution Principle SWE 332 – Fall Liskov Substitution Principle In any client code, if subtype object is substituted for supertype object,
Intro Programming By Trevor Decker Team 1743 By Trevor Decker Team 1743.
Crossword Puzzle Solver Michael Keefe. Solver structure.
Application Code PDP PEP public void borrowBook (User user, Book book, Context context) throws PolicyViolationException { Request request = new Request.
Database Programming Dr. John Abraham. Data Sources Data source specifies the source of the data for an application. Click on Data from Menu Choose show.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
Test Your Knowledge. x + 3 =6 a.5 b.4 c.3 d.2 y - 11= 78 a. 69 b. 89 c. 87 d. 68.
Wii mote interfacing. The product It is a wireless device, using standard Bluetooth technology to communicate The Wii Remote uses the standard Bluetooth.
.NET 2.0 and Visual Studio 2005 SigWin Outline Language enhancements in C# Language enhancements in C# –Generics –Partial types –Anonymous methods.
Lecture 16: Multithreaded Programming. public partial class Form1 : Form { Thread ct; Thread rt; public static int circle_sleep = 0; public static int.
CS590VC – Tutorial 6 Client-side connection through external application.
Windows CardSpace Martin Parry Developer Evangelist Microsoft
private void Application_Launching(object sender, LaunchingEventArgs e) { } private void Application_Activated(object.
1NetBeans Tutorial Using the “Properties” menu, name the List “List1” and the button “Button1”. NetBeans Tutorial6.
Lecture Set 7 Procedures and Event Handlers Part B - The Structure of an Application Event Handlers.
 The MSP430 is a mixed-signal microcontroller family from Texas Instruments. Built around a 16-bit CPU, the MSP430 is designed for low cost and, specifically,
REM function that gets called when the network changes Private Sub OnNetworkChange (ByVal s As Object, _ ByVal a As EventArgs) REM Perform detection.
Regular Expressions In Javascript cosc What Do They Do? Does pattern matching on text We use the term “string” to indicate the text that the regular.
UOP PRG 421 W EEK 2 DQ 1 Check this A+ tutorial guideline at For more classes visit
UOP PRG 421 W EEK 2 DQ 2 Check this A+ tutorial guideline at For more classes visit
RDG 410 Week 2 Learning Team Assignment Phonemic Awareness and Phonics Minilesson Check this A+ tutorial guideline at
CJA 454 Week 3 DQ 2 NEW Check this A+ tutorial guideline at 454-NEW/CJA-454-Week-3-DQ-2-NEW Stress is a major management.
CJS 230 Corrections A World Apart Check this A+ tutorial guideline at /CJS-230/CJS-230-Complete-Class- Course For more classes.
CJS 230 WEEK 3 APPENDIX B - POPULATION AND PRIVATIZATION CheckPoint: Population and Privatization · Resource: Appendix B · Locate Appendix B on your aXcess.
CJS 230 WEEK 4 ASSIGNMENT PRISON SYSTEMS Check this A+ tutorial guideline at WEEK-4-ASSIGNMENT-PRISON-SYSTEMS.
CRJ 303 Week 3 Assignment Juvenile Corrections Check this A+ tutorial guideline at
CRJ 303 Week 4 Assignment Life As A Correctional Officer Check this A+ tutorial guideline at
ECO 205 Week 3 DQ 1 And DQ 2 Check this A+ tutorial guideline at 205/ECO-205-Week-3-DQ-1-And-DQ-2 Week 3 DQ 1 What.
ECO 205 Week 4 CheckPoint International Trade Debate Part II Check this A+ tutorial guideline at 205/ECO-205-Week-4-CheckPoint-
ECO 365 Complete Class Check this A+ tutorial guideline at 365/ECO-365-Complete-Class For more classes visit
ECO 372 Complete Class Check this A+ tutorial guideline at O-372/ECO-372-Complete-Class For more classes visit
ETH 316 Complete Class Check this A+ tutorial guideline at 316/ETH-316-Complete-Class. For more classes visit
BSHS-311-Complete-Class Check this A+ tutorial guideline at 311/BSHS-311-Complete-Class For more classes visit
BSHS 342 Complete Class Check this A+ tutorial guideline at 342/BSHS-342-Complete-Classhttp://
BSHS 442 Week 1 Summary Check this A+ tutorial guideline at 442/BSHS-442-Week-1-Summary Please post a 200 – 300 word.
BSHS 442 Week 4 Summary Check this A+ tutorial guideline at 442/BSHS-442-Week-4-Summary Please post a 200 – 300 word.
BSHS 442 Week 5 Summary Please post a 200 – 300 word weekly summary describing what you have learned this week. Check this A+ tutorial guideline at
BCOM 275 Complete Class Check this A+ tutorial guideline at 275/BCOM-275-Complete-Class. For more classes visit
BCOM-405-Complete Class Check this A+ tutorial guideline at 405/BCOM-405-Complete-Class. For more classes visit
BCOM 426 Complete Class Check this A+ tutorial guideline at 426-Complete-Class. For more classes visit
BIS 219 Complete Class Check this A+ tutorial guideline at Complete-Class. For more classes visit
BIS 303 Complete Class Check this A+ tutorial guideline at S-303/BIS-303-Complete-Class-Guide For more classes visit.
BIS 318 Complete Class Check this A+ tutorial guideline at Complete-Class-Guide For more classes visit.
BIS 320 Complete Class Check this A+ tutorial guideline at 320/BIS-320-Complete-Class-Guide For more classes visit.
BIS 320 Week 2 DQ 1 What is the value of information? Is it an asset? Why or why not? Can you use information for decision making? How could databases.
BSA 310 Complete Class Business Systems Check this A+ tutorial guideline at 310/BSA-310-Complete-Class. For more classes.
ACC 225 Week 1 Exercise Accounting and Business Organizations · Resource: Fundamental Accounting Principles, p. 30 · Post your answers to Exercises 1-1.
ACC 225 Week 4 CheckPoint Preparing Balance Sheets and Statements · Resource: Fundamental Accounting Principles, pp. 156 and 159 · Complete Quick Study.
ACC 230 Check this A+ tutorial guideline at /ACC-230/ACC-230-Complete- Class. For more classes visit
ACC 290 Complete Class Check this A+ tutorial guideline at 290/ACC-290-Complete-Classhttp://
What’s cheating and what is not?
Supervisor Approval Instructions- Absence Requests
How to Correct a Quiz or Test
Functions Used to write code only once Can use parameters.
How to Add Images Using an 'openFile' Dialog
AOP in .NET Business Rules + Plumbing = Enterprise Software
Midterm Thursday, in class.
Web Service.
Quiz Name Here Click to start.
Quiz Name Here Click to start.
1. What Google app created this assessment?
BMI Form1 Body Mass Index textBox3-4 (readonly) trackBar1
½ of 6 = 3.
Martin Parry Developer Evangelist Microsoft
Creating Controls Dynamically in C#
Tutorial Number 8 - Daniel Razavi
label1 Name label2 Time (0-23) textBox1 textBox2 textBox3 button1
Poker2.jpg Poker14.jpg int num1, num2;
Presentation transcript:

Example: Checking for correct UK Postcode PostCodeTextBox CheckButton private void CheckButton_Click(object sender, EventArgs e) { if (Regex.IsMatch(PostCodeTextBox.Text, "^(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKPS-UW]) {0,1}[0-9][ABD-HJLNP-UW-Z]{2})$")) errorProvider1.SetError(PostCodeTextBox , String.Empty); } else errorProvider1.SetError(PostCodeTextBox, "Not a UK postcode!\nTry again."); Where does this string monster come from? Just google: c# regex uk post code (or whatever you are looking for)

RegEx References The RegEx Cheat Sheet can be found here The official Microsoft reference is here A tutorial can be found here