docs(lib): narrate remaining stdlib modules (M2)

Add module intros and per-function purpose lines across EN/ZH libs, with
callable examples on the smaller modules; keep + params and host bodies intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-14 11:47:35 +08:00
1 parent 53bc3538da
commit fecaacd5be
49 files changed
+617 -21

No files matched your search

+13 -1
View File
@@ -3,22 +3,32 @@ title: lib/re
description: Regular expressions (Mid M1). Unicode; no backreferences.
---
Regular expressions. Unicode; no backreferences. Prefer lib/text for literal replace.
## is_match
+ `text`
+ `pattern`
Whether text matches pattern.
Caller: [re.is_match] text=`s` pattern="a+"
*> host_re_is_match text=`text` pattern=`pattern`*
## find
+ `text`
+ `pattern`
First match of pattern in text, or None.
*> host_re_find text=`text` pattern=`pattern`*
## find_all
+ `text`
+ `pattern`
All matches of pattern in text.
*> host_re_find_all text=`text` pattern=`pattern`*
## replace
@@ -27,7 +37,7 @@ description: Regular expressions (Mid M1). Unicode; no backreferences.
+ `with`
+ `count`=None
Optional `count=` limits replacements (`None` = all).
Replace matches of pattern in text with with; optional count limits replacements (None = all).
*> host_re_replace text=`text` pattern=`pattern` with=`with` count=`count`*
@@ -35,4 +45,6 @@ Optional `count=` limits replacements (`None` = all).
+ `text`
+ `pattern`
Split text on pattern.
*> host_re_split text=`text` pattern=`pattern`*