Chapter 9. Strings and Regular Expressions


Python supports plain and Unicode strings extensively, with statements, operators, built-in functions, methods, and dedicated modules. This chapter covers the methods of string objects, in "Methods of String Objects" on page 186; string formatting, in "String Formatting" on page 193; modules string (in "The string Module" on page 191), pprint (in "The pprint Module" on page 197), and repr (in "The repr Module" on page 198); and issues related to Unicode strings, in "Unicode" on page 198.

Regular expressions let you specify pattern strings and allow searches and substitutions. Regular expressions are not easy to master, but they can be a powerful tool for processing text. Python offers rich regular expression functionality through the built-in re module, documented in "Regular Expressions and the re Module" on page 201.




Python in a Nutshell
Python in a Nutshell, Second Edition (In a Nutshell)
ISBN: 0596100469
EAN: 2147483647
Year: 2004
Pages: 192
Authors: Alex Martelli

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