Class Notes (888,895)
US (344,949)
UVA (2,184)
CS (38)
CS 1110 (9)
Lecture 1

CS 1110 Lecture 1: November 17 – Re Building

2 Pages

Computer Science
Course Code
CS 1110

This preview shows 80% of the first page. Sign up to view the full 2 pages of the document.

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
November 17 Re Building Sunday, November 5, 2017 11:19 AM Guidelines 1. Create good and bad example stirngs first; mark them off manually 2. Use r'' strings not '' strings 3. Go left to right 4. Pick the right kind of "or": [ab] for single character, (ab|cd) for longer 5. Optional: ()?, And several: ()* [^oe] selects complement of oe, and selects everything but oe Three rules of Regex: 1. Left to right: you want to build leftmost to rightmost o Write down some examples and cross them off as you go 2. Kinds of "one of": doesn't matter which ones come up 3. Maybe, many, one o Question mark signifies maybe x after this >> ( )? Question mark is only good for single character o May be one of them: ? o Might be 0 or more: * o Might be 1 or more: + You should pretty much always use an 'r' string inside a regular expression so backlashes work in a certain way How to handle back\slashes: 16:30 Write single copy of thing to be repeated, and put a parenthesis and * after it " ( [^"\\]*(\\.)? )* " Is the same as " ( [^"\\] | \\.)* " Either non backlash periods or period Strings = re.compile(r' " ( [^"\\] | \\.)* " ') For match in strings.finditer(text): Print( Example: one
More Less
Unlock Document
Subscribers Only

Only 80% of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
Subscribers Only
You're Reading a Preview

Unlock to view full version

Unlock Document
Subscribers Only

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.