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; string formatting, in String Formatting; modules string (in The string Module), pprint (in The pprint Module), and repr (in The repr Module); and issues related to Unicode strings, in Unicode.
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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access