Download presentation
Presentation is loading. Please wait.
Published byPiers Cummings Modified over 9 years ago
1
WEEK 6 Jeongmin Lee 1
2
Goal Having experience with Regular Expressions Develop a program that checks user input that is course number of CS dept. “CS2014” (good) / “IS1000” (bad) / “CS6000” (bad) 2
3
Regular Expressions 3
4
4 ©Jussi Pohjolainen
5
5
6
6
7
7
8
8
9
9
10
10 ©Jussi Pohjolainen
11
11 ©Jussi Pohjolainen
12
12 ©Jussi Pohjolainen
13
13 ©Jussi Pohjolainen
14
14 ©Jussi Pohjolainen
15
Let’s do it 15 Write a PHP script that does the following: 1. Shows the user a form requesting a search for a computer science course. 2. The course must be formatted as follows: CSXYYY where C is an either upper or lower case 'C' character where S is an either upper or lower case 'S' character where X is either a 0, 1, 2 or 3 where YYY are digits between 0 and 9 3. When submitted, the form should request the same script again. When processing the submission, the script should check the validity of the entered course number. If it is valid, it should report back that the course is legitimate. Otherwise, it should report back to the user that he/she made a format error. 4. In order to allow another entry, the processed result should also include the form (so the user will see one result and can enter a new course on the same page). Demonstrate your script by running it a few times for the instructor, both with a correct submission and an incorrect submission.
16
Resource 16 http://www.phpliveregex.com http://www.phpliveregex.com http://regexone.com http://regexone.com ex18.php in phpexamples folder
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.