Comply with go regexp & user defined regular expression prefix (#164)

To avoid further confusion like this: https://github.com/v2fly/domain-list-community/issues/163
This commit is contained in:
Loyalsoldier
2020-08-19 20:44:54 +08:00
committed by GitHub
parent f587eaeb04
commit a98b29b562
11 changed files with 30 additions and 28 deletions

View File

@ -81,19 +81,21 @@ All data are under `data` directory. Each file in the directory represents a sub
include:another-file
domain:google.com @attr1 @attr2
keyword:google
regex:www\.google\.com
regexp:www\.google\.com$
full:www.google.com
```
**Syntax:**
> The following types of rules are **NOT** fully compatible with the ones that defined by user in V2Ray config file. Do **Not** copy and paste directly.
* Comment begins with `#`. It may begin anywhere in the file. The content in the line after `#` is treated as comment and ignored in production.
* Inclusion begins with `include:`, followed by the file name of an existing file in the same directory.
* Subdomain begins with `domain:`, followed by a valid domain name. The prefix `domain:` may be omitted.
* Keyword begins with `keyword:`, followed by a string.
* Regular expression begins with `regex:`, followed by a valid regular expression (per Golang's standard).
* Regular expression begins with `regexp:`, followed by a valid regular expression (per Golang's standard).
* Full domain begins with `full:`, followed by a complete and valid domain name.
* Domains (including `domain`, `keyword`, `regex` and `full`) may have one or more attributes. Each attribute begins with `@` and followed by the name of the attribute.
* Domains (including `domain`, `keyword`, `regexp` and `full`) may have one or more attributes. Each attribute begins with `@` and followed by the name of the attribute.
## How it works
@ -106,7 +108,7 @@ To generate a section:
3. Omit all empty lines.
4. Generate each `domain:` line into a [sub-domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L21).
5. Generate each `keyword:` line into a [plain domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L17).
6. Generate each `regex:` line into a [regex domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L19).
6. Generate each `regexp:` line into a [regex domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L19).
7. Generate each `full:` line into a [full domain routing rule](https://github.com/v2fly/v2ray-core/blob/master/app/router/config.proto#L23).
## How to organize domains