File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,9 @@ export const URL_REGEX = new RegExp(protocol + hostname + "(?:" + port + ")?(?:"
6262 * Domain name regular expression
6363 */
6464export const DOMAIN_REGEX = / \b ( (? = [ a - z 0 - 9 - ] { 1 , 63 } \. ) ( x n - - ) ? [ a - z 0 - 9 ] + ( - [ a - z 0 - 9 ] + ) * \. ) + [ a - z ] { 2 , 63 } \b / ig;
65+
66+
67+ /**
68+ * DMARC Domain name regular expression
69+ */
70+ export const DMARC_DOMAIN_REGEX = / \b ( (? = [ a - z 0 - 9 _ - ] { 1 , 63 } \. ) ( x n - - ) ? [ a - z 0 - 9 _ ] + ( - [ a - z 0 - 9 _ ] + ) * \. ) + [ a - z ] { 2 , 63 } \b / ig;
Original file line number Diff line number Diff line change 55 */
66
77import Operation from "../Operation.mjs" ;
8- import { search , DOMAIN_REGEX } from "../lib/Extract.mjs" ;
8+ import { search , DOMAIN_REGEX , DMARC_DOMAIN_REGEX } from "../lib/Extract.mjs" ;
99import { caseInsensitiveSort } from "../lib/Sort.mjs" ;
1010
1111/**
@@ -39,6 +39,11 @@ class ExtractDomains extends Operation {
3939 name : "Unique" ,
4040 type : "boolean" ,
4141 value : false
42+ } ,
43+ {
44+ name : "Underscore (DMARC, DKIM, etc)" ,
45+ type : "boolean" ,
46+ value : false
4247 }
4348 ] ;
4449 }
@@ -49,11 +54,11 @@ class ExtractDomains extends Operation {
4954 * @returns {string }
5055 */
5156 run ( input , args ) {
52- const [ displayTotal , sort , unique ] = args ;
57+ const [ displayTotal , sort , unique , dmarc ] = args ;
5358
5459 const results = search (
5560 input ,
56- DOMAIN_REGEX ,
61+ dmarc ? DMARC_DOMAIN_REGEX : DOMAIN_REGEX ,
5762 null ,
5863 sort ? caseInsensitiveSort : null ,
5964 unique
You can’t perform that action at this time.
0 commit comments