text.md
1> **Источник:** https://python-all.ru/3.15/library/text.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Службы обработки текста89Модули, описанные в этой главе, предоставляют широкий набор операций по работе со строками и других служб обработки текста.1011Модуль [`codecs`](https://python-all.ru/3.15/library/codecs.html#module-codecs), описанный в разделе [Службы двоичных данных](https://python-all.ru/3.15/library/binary.html#binaryservices), также имеет прямое отношение к обработке текста. Дополнительно см. документацию по встроенному строковому типу Python в [Тип последовательности текста – str](https://python-all.ru/3.15/library/stdtypes.html#textseq).1213- [`string` – Общие операции со строками](https://python-all.ru/3.15/library/string.html)1415 - [Строковые константы](https://python-all.ru/3.15/library/string.html#string-constants)16 - [Пользовательское форматирование строк](https://python-all.ru/3.15/library/string.html#custom-string-formatting)17 - [Синтаксис форматных строк](https://python-all.ru/3.15/library/string.html#format-string-syntax)1819 - [Мини-язык спецификации формата](https://python-all.ru/3.15/library/string.html#format-specification-mini-language)20 - [Примеры форматирования](https://python-all.ru/3.15/library/string.html#format-examples)21 - [Строки-шаблоны ($-strings)](https://python-all.ru/3.15/library/string.html#template-strings-strings)22 - [Вспомогательные функции](https://python-all.ru/3.15/library/string.html#helper-functions)23- [`string.templatelib` – Поддержка шаблонных строковых литералов](https://python-all.ru/3.15/library/string.templatelib.html)2425 - [Строки-шаблоны](https://python-all.ru/3.15/library/string.templatelib.html#template-strings)26 - [Типы](https://python-all.ru/3.15/library/string.templatelib.html#types)27 - [Вспомогательные функции](https://python-all.ru/3.15/library/string.templatelib.html#helper-functions)28- [`re` – Операции с регулярными выражениями](https://python-all.ru/3.15/library/re.html)2930 - [Синтаксис регулярных выражений](https://python-all.ru/3.15/library/re.html#regular-expression-syntax)31 - [Содержание модуля](https://python-all.ru/3.15/library/re.html#module-contents)3233 - [Флаги](https://python-all.ru/3.15/library/re.html#flags)34 - [Функции](https://python-all.ru/3.15/library/re.html#functions)35 - [Исключения](https://python-all.ru/3.15/library/re.html#exceptions)36 - [Объекты регулярных выражений](https://python-all.ru/3.15/library/re.html#regular-expression-objects)37 - [Объекты сопоставления](https://python-all.ru/3.15/library/re.html#match-objects)38 - [Примеры регулярных выражений](https://python-all.ru/3.15/library/re.html#regular-expression-examples)3940 - [Проверка наличия пары](https://python-all.ru/3.15/library/re.html#checking-for-a-pair)41 - [Имитация scanf()](https://python-all.ru/3.15/library/re.html#simulating-scanf)42 - [search() и prefixmatch()](https://python-all.ru/3.15/library/re.html#search-vs-prefixmatch)43 - [prefixmatch() и match()](https://python-all.ru/3.15/library/re.html#prefixmatch-vs-match)44 - [Создание телефонной книги](https://python-all.ru/3.15/library/re.html#making-a-phonebook)45 - [Обработка текста](https://python-all.ru/3.15/library/re.html#text-munging)46 - [Поиск всех наречий](https://python-all.ru/3.15/library/re.html#finding-all-adverbs)47 - [Поиск всех наречий и их позиций](https://python-all.ru/3.15/library/re.html#finding-all-adverbs-and-their-positions)48 - [Сырые строки](https://python-all.ru/3.15/library/re.html#raw-string-notation)49 - [Написание токенизатора](https://python-all.ru/3.15/library/re.html#writing-a-tokenizer)50- [`difflib` – Вспомогательные функции для вычисления разностей](https://python-all.ru/3.15/library/difflib.html)5152 - [Объекты SequenceMatcher](https://python-all.ru/3.15/library/difflib.html#sequencematcher-objects)53 - [Примеры SequenceMatcher](https://python-all.ru/3.15/library/difflib.html#sequencematcher-examples)54 - [Объекты Differ](https://python-all.ru/3.15/library/difflib.html#differ-objects)55 - [Пример Differ](https://python-all.ru/3.15/library/difflib.html#differ-example)56 - [Интерфейс командной строки для difflib](https://python-all.ru/3.15/library/difflib.html#a-command-line-interface-to-difflib)57 - [Пример ndiff](https://python-all.ru/3.15/library/difflib.html#ndiff-example)58- [`textwrap` – Перенос и заполнение текста](https://python-all.ru/3.15/library/textwrap.html)59- [`unicodedata` – База данных Unicode](https://python-all.ru/3.15/library/unicodedata.html)60- [`stringprep` – Подготовка строк для интернета](https://python-all.ru/3.15/library/stringprep.html)61- [`readline` – Интерфейс GNU readline](https://python-all.ru/3.15/library/readline.html)6263 - [Файл инициализации](https://python-all.ru/3.15/library/readline.html#init-file)64 - [Буфер строки](https://python-all.ru/3.15/library/readline.html#line-buffer)65 - [Файл истории](https://python-all.ru/3.15/library/readline.html#history-file)66 - [Список истории](https://python-all.ru/3.15/library/readline.html#history-list)67 - [Перехватчики запуска](https://python-all.ru/3.15/library/readline.html#startup-hooks)68 - [Автодополнение](https://python-all.ru/3.15/library/readline.html#completion)69 - [Пример](https://python-all.ru/3.15/library/readline.html#example)70- [`rlcompleter` – Функция автодополнения для GNU readline](https://python-all.ru/3.15/library/rlcompleter.html)71