diff options
author | Simone Mainardi <mainardi@ntop.org> | 2018-08-17 13:13:26 +0200 |
---|---|---|
committer | Simone Mainardi <mainardi@ntop.org> | 2018-08-17 13:13:26 +0200 |
commit | 291acb94591da6fd9abf7c56177e61d35726f8f6 (patch) | |
tree | 8e71b02d32b92ea2b2237cc56b37df9d5e406844 | |
parent | 47c2ad1b5f6e7a790a0b46d3950c915aad9c2f8f (diff) |
Hyperscan regex for domains such as .com.cn or .co.uk
-rw-r--r-- | src/lib/ndpi_content_match.c.inc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc index 2ba38dee1..60bc3498f 100644 --- a/src/lib/ndpi_content_match.c.inc +++ b/src/lib/ndpi_content_match.c.inc @@ -8015,12 +8015,15 @@ Each part of a domain name can be no longer than 63 characters. There are no sin https://www.regular-expressions.info/email.html -We also add an optional .co to match domains such as .co.uk - (?i) is to make searches case insensitive + +(?:) is a non-capturing group used to allow patterns such as .co.uk or .com.cn + The non-capturing group is used in a nested fashion to capture the + .co, and then, optionally, another m. + */ -#define TLD "(?i)(\\.co){0,1}\\.[a-z]{2,63}$" +#define TLD "(?i)(?:\\.co(?:m)?)?\\.[a-z]{2,63}$" /* ****************************************************** */ |