Week 6

One

Here is a character string with a regular expression:

"([2-9][0-9]{2})[- .]([0-9]{3})[- .]([0-9]{4})"

To explain the first bit …
* [2-9] means “one digit from 2 to 9. * [0-9] refers to one digit from 0 to 9. * [0-9]{2} refers to two consecutive digits, 0 to 9. * [2-9][0-9]{2} means one digit 2 to 9 followed by two digits 0 to 9 * [- .] means”any of the characters dash, space, period, just once. * The parentheses refer to the matching contents to be extracted. The whole expression has the structure (stuff)[- .](more stuff)[- .](still more stuff). The three sets of parentheses mean to extract those three pieces from strings thatmatch.

Explain what familiar kinds of strings the entire general expression would match. What components of those strings is being extracted?

Two

  • What does readHTMLTable() do?