Ingredients
- A configuration that already works (single subscription or merged)
- Node names that carry a region marker, such as "Hong Kong", "HK" or "🇯🇵"
The idea
mihomo groups can pick nodes by name with a filter regex. With include-all: true, the group takes every node whose name matches from all providers, and url-test then picks the lowest delay automatically.

Steps
proxy-groups:
- name: Hong Kong
type: url-test
include-all: true
filter: "(?i)港|\\bHK\\b|Hong ?Kong"
exclude-filter: "剩余|到期|官网"
url: https://www.gstatic.com/generate_204
interval: 300
- name: Japan
type: url-test
include-all: true
filter: "(?i)日本|\\bJP\\b|Japan|Tokyo"
url: https://www.gstatic.com/generate_204
interval: 300- Copy a few node names and try the regex in the workshop's node name filter to make sure it catches what it should and nothing else.
- Paste the generated groups under
proxy-groupsin the configuration. - Refer to the groups in rules, for example send a streaming service to "Japan".
Regex pitfalls
| Pattern | Problem | Use instead |
|---|---|---|
HK | Also catches names that happen to contain the letters, like "SHKL-01" | \bHK\b |
US | Matches "Russia" | \bUS\b |
No (?i) | Misses a lower-case "japan" | Add (?i) at the start |
Check
On the Proxies page, make sure each region group holds the right nodes and run a speed test. An empty group means the regex matched nothing; go back to the filter tool and adjust it.
Why two backslashes in the YAML?
Inside a double-quoted string, \\b is what gives \b in the regex. With single quotes, one is enough.
Do new nodes join groups automatically?
Yes. After a subscription update, new nodes whose names match go into the right groups.