7. String Services — Python 2.7.18 documentation (original) (raw)
The modules described in this chapter provide a wide range of string manipulation operations.
In addition, Python’s built-in string classes support the sequence type methods described in the Sequence Types — str, unicode, list, tuple, bytearray, buffer, xrange section, and also the string-specific methods described in the String Methods section. To output formatted strings use template strings or the %
operator described in the String Formatting Operations section. Also, see there module for string functions based on regular expressions.
- 7.1. string — Common string operations
- 7.2. re — Regular expression operations
- 7.2.1. Regular Expression Syntax
- 7.2.2. Module Contents
- 7.2.3. Regular Expression Objects
- 7.2.4. Match Objects
- 7.2.5. Examples
* 7.2.5.1. Checking For a Pair
* 7.2.5.2. Simulating scanf()
* 7.2.5.3. search() vs. match()
* 7.2.5.4. Making a Phonebook
* 7.2.5.5. Text Munging
* 7.2.5.6. Finding all Adverbs
* 7.2.5.7. Finding all Adverbs and their Positions
* 7.2.5.8. Raw String Notation
- 7.3. struct — Interpret strings as packed binary data
- 7.4. difflib — Helpers for computing deltas
- 7.5. StringIO — Read and write strings as files
- 7.6. cStringIO — Faster version of StringIO
- 7.7. textwrap — Text wrapping and filling
- 7.8. codecs — Codec registry and base classes
- 7.8.1. Codec Base Classes
* 7.8.1.1. Codec Objects
* 7.8.1.2. IncrementalEncoder Objects
* 7.8.1.3. IncrementalDecoder Objects
* 7.8.1.4. StreamWriter Objects
* 7.8.1.5. StreamReader Objects
* 7.8.1.6. StreamReaderWriter Objects
* 7.8.1.7. StreamRecoder Objects - 7.8.2. Encodings and Unicode
- 7.8.3. Standard Encodings
- 7.8.4. Python Specific Encodings
- 7.8.5. encodings.idna — Internationalized Domain Names in Applications
- 7.8.6. encodings.utf_8_sig — UTF-8 codec with BOM signature
- 7.8.1. Codec Base Classes
- 7.9. unicodedata — Unicode Database
- 7.10. stringprep — Internet String Preparation
- 7.11. fpformat — Floating point conversions