✅ Keep-Only Character Filter

📐 工作原理與說明
反向保留:把勾選的字元類(數字 0-9、小寫 a-z、大寫 A-Z、字母 a-zA-Z、中文 \u4e00-\u9fff、中英文標點、空白 \s)與自定義字元(先轉義正則元字元)拼成一個集合,構造否定字元類 [^集合],按 g 或 gi 把不在此集合內的字元全部刪除;未選任何保留項時提示請選擇要保留的字元。啟用自定義正則時改為取出全部命中片段,再按選項決定用換行還是空串連線

Reverse filtering that keeps only the characters or character classes you specify (for example Chinese or digits) and drops everything else from mixed text.

保留選項

📋 結果

請輸入文本...

📚 深度解析:僅保留匹配項

💡 常見使用場景

  • 反向過濾:只留含目標詞的行,刪掉其餘,聚焦關鍵內容。
  • 白名單抽取:從混合文本保留特定模式(如保留含訂單號行)。
  • 降噪:在混亂日誌裡只留關心的訊號。
只留含『支付』的行
1000 行文本里設保留「支付」,輸出僅 42 行支付相關;與「按條件過濾」的區別是它直接丟棄不匹配行而非僅隱藏。

❓ 常見問題(FAQ)

和文本過濾有什麼區別?
文本過濾多為「顯示/排除」,本工具是「僅保留匹配、丟棄其餘」,輸出即子集,適合直接產出目標清單。
多關鍵詞怎麼算?
可設「任一匹配即保留」或「全部匹配才保留」,按是否需要 AND/OR 語義選擇。

Formula & Standard References

Item Formula / Note Source / Standard
Character category keeping characters by category follows the Unicode general categories Unicode UAX #44, character database
Whitespace handling whitespace is a separator class whose retention changes later tokenisation Unicode UAX #29, word boundaries
Width compatibility fullwidth characters equal halfwidth after compatibility normalisation Unicode UAX #15, normalisation forms
⚠️ 使用說明與注意事項