mirror of https://github.com/gorhill/uBlock.git
Refine AST template's regex for hosts file entries
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2512
This commit is contained in:
parent
491bc87e94
commit
09bc4e21c7
|
@ -717,8 +717,8 @@ export class AstFilterParser {
|
||||||
this.reHnAnchoredHostnameUnicode = /^\|\|(?:[\p{L}\p{N}][\p{L}\p{N}\u{2d}]*\.)*[\p{L}\p{N}\u{2d}]*[\p{L}\p{N}]\^$/u;
|
this.reHnAnchoredHostnameUnicode = /^\|\|(?:[\p{L}\p{N}][\p{L}\p{N}\u{2d}]*\.)*[\p{L}\p{N}\u{2d}]*[\p{L}\p{N}]\^$/u;
|
||||||
this.reHn3pAnchoredHostnameAscii = /^\|\|(?:[\da-z][\da-z_-]*\.)*[\da-z_-]*[\da-z]\^\$third-party$/;
|
this.reHn3pAnchoredHostnameAscii = /^\|\|(?:[\da-z][\da-z_-]*\.)*[\da-z_-]*[\da-z]\^\$third-party$/;
|
||||||
this.rePlainAscii = /^[0-9a-z%&\-.\/:;=?_]{2,}$/;
|
this.rePlainAscii = /^[0-9a-z%&\-.\/:;=?_]{2,}$/;
|
||||||
this.reNetHosts1 = /^127\.0\.0\.1 (?:[\da-z][\da-z_-]*\.)*[\da-z-]*[\da-z]$/;
|
this.reNetHosts1 = /^127\.0\.0\.1 (?:[\da-z][\da-z_-]*\.)+[\da-z-]*[a-z]$/;
|
||||||
this.reNetHosts2 = /^0\.0\.0\.0 (?:[\da-z][\da-z_-]*\.)*[\da-z-]*[\da-z]$/;
|
this.reNetHosts2 = /^0\.0\.0\.0 (?:[\da-z][\da-z_-]*\.)+[\da-z-]*[a-z]$/;
|
||||||
this.rePlainGenericCosmetic = /^##[.#][A-Za-z_][\w-]*$/;
|
this.rePlainGenericCosmetic = /^##[.#][A-Za-z_][\w-]*$/;
|
||||||
this.reHostnameAscii = /^(?:[\da-z][\da-z_-]*\.)*[\da-z-]*[\da-z]$/;
|
this.reHostnameAscii = /^(?:[\da-z][\da-z_-]*\.)*[\da-z-]*[\da-z]$/;
|
||||||
this.rePlainEntity = /^(?:[\da-z][\da-z_-]*\.)+\*$/;
|
this.rePlainEntity = /^(?:[\da-z][\da-z_-]*\.)+\*$/;
|
||||||
|
|
Loading…
Reference in New Issue