Outline for November 7, 2023

Reading: §14, 12, 13
Due: Homework 3, due November 9, 2023


  1. Useful abbreviations in patterns
    1. \d matches any digit; same as [0-9]
    2. \s matches any space character; same as [ \t\n\r\f\v]
    3. \w matches any alphanumeric character and underscore; same as [a-zA-Z0-9_]
    4. \D matches any character except a digit; inverse of \d
    5. \S matches any character except a space character; inverse of \s
    6. \W matches any character except an alphanumeric character or underscore; inverse of \w
    7. \b matches a word boundary — a word is a sequence of alphanumeric characters

  2. “Raw” string notation: backslash not handled specially; put “r” before string

  3. Example of floating imprecision [roundoff.py]

  4. Character/integer conversions [chr.py, ord.py]
    1. Cæsar cipher (shift cipher) [caesarenc.py, caesardec.py]

  5. Reading a URL [geturl.py, geturl2.py, geturl3.py]
    1. Opening a URL
    2. Reading the page as a string
    3. The role of decode() [geturl-nd.py]

  6. A program to print links in web pages [urlpat.py, urlpat2.py]

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 235A, Computer and Information Security
Version of November 2, 2023 at 11:28PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh