Chapter 15


1.

Matching strings

bat, hat, bit, etc.

[bh][aiu]t


2.

First name last

[A-Za-z-]+ [A-Za-z-]+


(Any pair of words separated by a single space, e.g., first and last names, hyphens allowed)

3.

Last name first

[A-Za-z-]+, [A-Za-z]


(Any word and single letter separated by a comma and single space, e.g., last name, first initial)

[A-Za-z-]+, [A-Za-z-]+


(Any pair of words separated by a comma and single space, e.g., last, first names, hyphens allowed)

8.

Python longs

\d+[lL]


(Decimal [base 10] integers only)

9.

Python floats

[0-9]+(\.[0-9]*)?


(Describes a simple floating point number, that is, any number of digits followed optionally by a single decimal point and zero or more numeric digits, as in "0.004," "2," "75.," etc.)



Core Python Programming
Core Python Programming (2nd Edition)
ISBN: 0132269937
EAN: 2147483647
Year: 2004
Pages: 334
Authors: Wesley J Chun

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net