eg-259:homework:9
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
eg-259:homework:9 [2011/02/22 09:22] – [3. Practical Exercises] eechris | eg-259:homework:9 [2012/02/22 13:55] – [3. Practical Exercises] eechris | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Text Processing with Regular Expressions ====== | ====== Text Processing with Regular Expressions ====== | ||
- | **Adapted from**: Chapter 4 of Robert W. Sebasta, // | + | **Adapted from**: Chapter 4 of Robert W. Sebasta, // |
- | Write, test and debug (if necessary) | + | Write, test and debug (if necessary) |
Line 12: | Line 12: | ||
- //Input//: A text string, using '' | - //Input//: A text string, using '' | ||
- // | - // | ||
+ | - Use the function developed in Exercise 3 to validate a form with a text field that captures the user's name when the user presses the submit button. The form should not submit data if the name is not in the correct format. Use the example given in the session as a template. | ||
+ | - Repeat exercise 4 using the built-in HTML5 '' | ||
Line 32: | Line 34: | ||
===== 3. Practical Exercises ===== | ===== 3. Practical Exercises ===== | ||
- | * Copy and paste the following text into the //Target// window of [[/~eechris/ | + | * Copy and paste the following text into the //Target// window of [[/eg-259/ |
- | The quick brown fox jumped over the lazy dog. | ||
- | | ||
Xooo | Xooo | ||
oXoo | oXoo | ||
Line 45: | Line 45: | ||
0123456789 `|\<>, | 0123456789 `|\<>, | ||
| | ||
- | | + | |
| | ||
some.one@swan.ac.uk | some.one@swan.ac.uk | ||
Line 51: | Line 51: | ||
Some wiki text with words in //italic// and **bold**. Like //this// or **that**. | Some wiki text with words in //italic// and **bold**. Like //this// or **that**. | ||
| | ||
- | Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into | + | |
- | | + | |
- | pictures or conversation?' | + | |
+ | | ||
+ | | ||
+ | |||
+ | So she was considering in her own mind (as well as she could, for the hot day made her | ||
+ | feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth | ||
+ | the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink | ||
+ | eyes ran close by her. | ||
| | ||
- | | + | |
- | of making | + | the way to hear the Rabbit say to itself, `Oh dear! Oh dear! I shall be late!' |
- | | + | thought it over afterwards, it occurred to her that she ought to have wondered at this, |
+ | but at the time it all seemed quite natural); but when the Rabbit actually took a watch | ||
+ | | ||
+ | feet, for it flashed across her mind that she had never before seen a rabbit with either a | ||
+ | waistcoat- pocket, or a watch to take out of it, and burning with curiosity, she ran | ||
+ | across | ||
+ | | ||
+ | ---- | ||
| | ||
- | | + | |
- | dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at | + | |
- | the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, | + | |
- | hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat- | + | |
- | pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to | + | |
- | see it pop down a large rabbit-hole under the hedge. | + | |
* Write regular expressions to match: | * Write regular expressions to match: | ||
- any non-blank line of text. | - any non-blank line of text. | ||
- | - any word. | + | - any // |
- the telephone number. | - the telephone number. | ||
- ''" | - ''" | ||
Line 78: | Line 87: | ||
- The user name of the email address. | - The user name of the email address. | ||
- The words in italics in the wiki text. | - The words in italics in the wiki text. | ||
+ | - The start of each sentence in the quotation from Alice in Wonderland. | ||
* Take any (or all) of the example JavaScript programs from the last three lectures and explore them in //Firebug// using the console, console logger and debugger. | * Take any (or all) of the example JavaScript programs from the last three lectures and explore them in //Firebug// using the console, console logger and debugger. |
eg-259/homework/9.txt · Last modified: 2012/02/22 13:58 by eechris