<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Over-Match on Tarragon</title><link>https://tarrragon.github.io/blog/tags/over-match/</link><description>Recent content in Over-Match on Tarragon</description><generator>Hugo -- gohugo.io</generator><language>zh-TW</language><copyright>Tarragon (CC BY 4.0)</copyright><lastBuildDate>Thu, 18 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tarrragon.github.io/blog/tags/over-match/index.xml" rel="self" type="application/rss+xml"/><item><title>over-match：規則比對過寬而誤命中</title><link>https://tarrragon.github.io/blog/til/terms/over-match/</link><pubDate>Thu, 18 Jun 2026 00:00:00 +0000</pubDate><guid>https://tarrragon.github.io/blog/til/terms/over-match/</guid><description>&lt;blockquote>
&lt;p>這個詞出現在「&lt;a href="../guard-misfires/">守衛和規則為什麼會誤觸&lt;/a>」這個問題裡——它是機制成因。&lt;/p>&lt;/blockquote>
&lt;p>over-match（過寬匹配，又稱 over-broad match、spurious match）指&lt;strong>規則或樣式寫得太寬，命中了不該命中的東西&lt;/strong>。&lt;/p>
&lt;p>如果說 &lt;a href="../false-positive/">false positive&lt;/a> 是「偵測器誤報」這個現象，over-match 就是它在規則比對層常見的&lt;strong>機制成因&lt;/strong>：不是偵測器壞了，是規則的涵蓋範圍超出了意圖。&lt;/p>
&lt;h2 id="常見場景">常見場景&lt;/h2>
&lt;ul>
&lt;li>regex 少了邊界或錨點：&lt;code>cat&lt;/code> 命中 &lt;code>category&lt;/code>、&lt;code>scatter&lt;/code>。&lt;/li>
&lt;li>glob 太寬：&lt;code>*.test.*&lt;/code> 連不想要的也掃進來。&lt;/li>
&lt;li>關鍵字比對沒看上下文：命中了字面、卻不管語境。&lt;/li>
&lt;/ul>
&lt;h2 id="怎麼收斂">怎麼收斂&lt;/h2>
&lt;p>把規則收窄到「恰好涵蓋意圖」：加邊界（&lt;code>\b&lt;/code>）、加錨點、加上下文條件。收窄要拿捏——太寬會 over-match（false positive），太窄會漏掉真的（false negative）。這個拉扯就是 &lt;a href="../precision/">precision&lt;/a> 與 &lt;a href="../recall/">recall&lt;/a> 的取捨。&lt;/p>
&lt;h2 id="相關概念">相關概念&lt;/h2>
&lt;ul>
&lt;li>它造成的現象：&lt;a href="../false-positive/">false positive&lt;/a>、&lt;a href="../spurious-warning/">spurious warning&lt;/a>。&lt;/li>
&lt;li>結果視角：當守衛因 over-match 被觸發，就是 &lt;a href="../false-trigger/">false trigger&lt;/a>。&lt;/li>
&lt;/ul></description><content:encoded><![CDATA[<blockquote>
<p>這個詞出現在「<a href="../guard-misfires/">守衛和規則為什麼會誤觸</a>」這個問題裡——它是機制成因。</p></blockquote>
<p>over-match（過寬匹配，又稱 over-broad match、spurious match）指<strong>規則或樣式寫得太寬，命中了不該命中的東西</strong>。</p>
<p>如果說 <a href="../false-positive/">false positive</a> 是「偵測器誤報」這個現象，over-match 就是它在規則比對層常見的<strong>機制成因</strong>：不是偵測器壞了，是規則的涵蓋範圍超出了意圖。</p>
<h2 id="常見場景">常見場景</h2>
<ul>
<li>regex 少了邊界或錨點：<code>cat</code> 命中 <code>category</code>、<code>scatter</code>。</li>
<li>glob 太寬：<code>*.test.*</code> 連不想要的也掃進來。</li>
<li>關鍵字比對沒看上下文：命中了字面、卻不管語境。</li>
</ul>
<h2 id="怎麼收斂">怎麼收斂</h2>
<p>把規則收窄到「恰好涵蓋意圖」：加邊界（<code>\b</code>）、加錨點、加上下文條件。收窄要拿捏——太寬會 over-match（false positive），太窄會漏掉真的（false negative）。這個拉扯就是 <a href="../precision/">precision</a> 與 <a href="../recall/">recall</a> 的取捨。</p>
<h2 id="相關概念">相關概念</h2>
<ul>
<li>它造成的現象：<a href="../false-positive/">false positive</a>、<a href="../spurious-warning/">spurious warning</a>。</li>
<li>結果視角：當守衛因 over-match 被觸發，就是 <a href="../false-trigger/">false trigger</a>。</li>
</ul>
]]></content:encoded></item></channel></rss>