re.sub() seems like the function to use for this, but consider the replace() method. 注意 replace() 也可以在單詞里面進(jìn)行替換,可以把 "swordfish" 變成 "sdeedfish",不過(guò) RE 也是可以做到的。(為了避免替換單詞的一部分,模式將寫成 \bword\b,這是為了要求 "word" 兩邊有一個(gè)單詞邊界。這是個(gè)超出...
www.dbjr.com.cn/article/271...htm 2025-6-9