Python logo

上個主題

內建的例外

下個主題

string --- 常見的字串操作

此頁面

  • 回報錯誤
  • 顯示原始碼

導航

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.14.0rc3 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 文本處理 (Text Processing) 服務
  • |
  • |

文本處理 (Text Processing) 服務¶

本章節介紹的模組 (module) 提供了廣泛的字串操作與其他文本處理服務。

在 二進位資料服務 下所描述的 codecs 模組也與文本處理高度相關。另外也請參閱在 Text Sequence Type --- str 中所描述的 Python 內建字串型別。

  • string --- 常見的字串操作
    • 字串常數
    • 自訂字串格式
    • 格式化文字語法
      • 格式規格 (Format Specification) 迷你語言
      • 格式範例
    • 模板字串 ($-strings)
    • 輔助函式
  • string.templatelib --- 對模板字串字面值的支援
    • 模板字串
    • Types
    • Helper functions
  • re --- 正規表示式 (regular expression) 操作
    • 正規表示式語法
    • 模組內容
      • 旗標
      • 函式
      • 例外
    • Regular Expression Objects
    • Match Objects
    • Regular Expression Examples
      • Checking for a Pair
      • 模擬 scanf()
      • search() vs. match()
      • Making a Phonebook
      • Text Munging
      • Finding all Adverbs
      • Finding all Adverbs and their Positions
      • Raw String Notation
      • Writing a Tokenizer
  • difflib --- 計算差異的輔助工具
    • SequenceMatcher 物件
    • SequenceMatcher 範例
    • Differ Objects
    • Differ Example
    • difflib 的命令列介面
    • ndiff 範例:
  • textwrap --- 文字包裝與填充
  • unicodedata --- Unicode 資料庫
  • stringprep --- 網際網路字串的準備
  • readline --- GNU readline 介面
    • Init file
    • Line buffer
    • History file
    • History list
    • Startup hooks
    • Completion
    • 範例
  • rlcompleter --- GNU readline 的補全函式

上個主題

內建的例外

下個主題

string --- 常見的字串操作

此頁面

  • 回報錯誤
  • 顯示原始碼
«

導航

  • 索引
  • 模組 |
  • 下一頁 |
  • 上一頁 |
  • Python logo
  • Python »
  • 3.14.0rc3 Documentation »
  • Python 標準函式庫 (Standard Library) »
  • 文本處理 (Text Processing) 服務
  • |
  • |
© 版權所有 2001 Python Software Foundation.
此頁面採用 Python 軟體基金會授權條款第 2 版。
文件中的範例、應用技巧與其他程式碼額外採用了 Zero Clause BSD 授權條款。
更多訊息請見歷史與授權條款。

Python 軟體基金會是一家非營利法人。 敬請捐贈。

最後更新於 9月 23, 2025 (00:19 UTC)。 發現 bug?
以 Sphinx8.2.3建立。