@@ -147,6 +147,71 @@ policy:
147147- **Multiple values/patterns in a rule**: Combined with **OR** (any value passes)
148148- **Multiple actual values**: For whitelist, ALL must match; for blacklist, NONE must match
149149
150+ ### ` values` vs `patterns`
151+
152+ Rules can use either (or both) `values` and `patterns` :
153+
154+ | Option | Matching Type | Use Case | Example |
155+ |--------|--------------|----------|---------|
156+ | `values` | **Exact string match** | Specific versions, exact license IDs | `MIT`, `Apache-2.0`, `log4j-core-2.17.1` |
157+ | `patterns` | **Regular expression** | License families, version ranges, naming conventions | `GPL-.*`, `.*-SNAPSHOT`, `log4j-1\..*` |
158+
159+ # ### Using `values` (Exact Match)
160+
161+ Use for precise matching when you know the exact values :
162+
163+ ` ` ` yaml
164+ rules:
165+ - field: license
166+ values:
167+ - MIT
168+ - Apache-2.0
169+ - BSD-3-Clause
170+ ` ` `
171+
172+ # ### Using `patterns` (Regex Match)
173+
174+ Use for matching **groups** or **families** of values :
175+
176+ ` ` ` yaml
177+ rules:
178+ - field: license
179+ patterns:
180+ - "^GPL-.*" # Any GPL variant (starts with "GPL-")
181+ - "^LGPL-.*" # Any LGPL variant
182+ - "^AGPL-.*" # Any AGPL variant
183+ ` ` `
184+
185+ **Common Regex Patterns:**
186+
187+ | Pattern | Matches | Example Values |
188+ |---------|---------|----------------|
189+ | `^GPL-.*` | GPL variants (start with "GPL-") | `GPL-2.0`, `GPL-3.0-only` |
190+ | `.*-SNAPSHOT` | Snapshot versions | `1.0.0-SNAPSHOT`, `2.1-SNAPSHOT` |
191+ | `log4j-1\..*` | Log4j 1.x versions | `log4j-1.2.17`, `log4j-1.2.19` |
192+ | `log4j-core-2\.1[0-6]\..*` | Log4j vulnerable (2.10-2.16) | `log4j-core-2.14.0` |
193+ | `^Apache-.*` | Apache licenses | `Apache-2.0`, `Apache-1.1` |
194+
195+ > **Note:** The `^` anchor ensures the match is at the **start** of the string. Without it, `GPL-.*` would also match `MIT OR GPL-2.0`.
196+
197+ # ### Combining `values` and `patterns`
198+
199+ You can use both together (combined with OR) :
200+
201+ ` ` ` yaml
202+ rules:
203+ - field: license
204+ values:
205+ - SSPL-1.0
206+ - CC-BY-SA-4.0
207+ patterns:
208+ - "^GPL-.*"
209+ - "^LGPL-.*"
210+ - "^AGPL-.*"
211+ ` ` `
212+
213+ This blocks : All GPL/LGPL/AGPL variants, plus SSPL-1.0 and CC-BY-SA-4.0.
214+
150215# # Examples
151216
152217# ## From Policy File
0 commit comments