name:
dist/Utilities/DateRegExBuilder.d.ts
-rw-r--r--
4613
1/**
2 * Build a regular expression step by step, to make it easier to build and read the resulting regular expressions.
3 */
4declare class DateRegExBuilder {
5 private regexString;
6 private static ZERO_OR_MORE_SPACES;
7 static DateRegExBuilder(): DateRegExBuilder;
8 /**
9 * Start the regular expression builder by matching the start of a line and zero or more spaces.
10 * @returns {DateRegExBuilder} builder
11 */
12 start(): DateRegExBuilder;
13 /**
14 * End the regular expression builder by matching the end of the line.
15 * @returns {DateRegExBuilder} builder
16 */
17 end(): DateRegExBuilder;
18 /**
19 * Capture all month full name and short names to the regular expression.
20 * @returns {DateRegExBuilder} builder
21 */
22 MONTHNAME(): DateRegExBuilder;
23 /**
24 * Capture all month full name and short names to the regular expression, in addition to any followed by one or more
25 * spaces.
26 * @returns {DateRegExBuilder} builder
27 * @constructor
28 */
29 MONTHNAME_W_SPACE(): DateRegExBuilder;
30 /**
31 * Add capture group for optionally capturing day names.
32 * @returns {DateRegExBuilder} builder
33 * @constructor
34 */
35 OPTIONAL_DAYNAME(): DateRegExBuilder;
36 /**
37 * Add capture group for optionally capturing a comma followed by one or more spaces.
38 * @returns {DateRegExBuilder} builder
39 * @constructor
40 */
41 OPTIONAL_COMMA(): DateRegExBuilder;
42 /**
43 * Add capture group for capturing month digits between 01 and 12, inclusively.
44 * @returns {DateRegExBuilder} builder
45 * @constructor
46 */
47 MM(): DateRegExBuilder;
48 /**
49 * Add capture group for capturing month digits between 01 and 12, inclusively, in addition to any followed by one or
50 * more spaces.
51 * @returns {DateRegExBuilder} builder
52 * @constructor
53 */
54 MM_W_SPACE(): DateRegExBuilder;
55 /**
56 * Add capture group for capturing day digits between 01 and 31, inclusively.
57 * @returns {DateRegExBuilder} builder
58 * @constructor
59 */
60 DD(): DateRegExBuilder;
61 /**
62 * Add capture group for capturing day digits between 01 and 31, inclusively, in addition to any followed by one or
63 * more spaces.
64 * @returns {DateRegExBuilder} builder
65 * @constructor
66 */
67 DD_W_SPACE(): DateRegExBuilder;
68 /**
69 * Add capture group for capturing 4 digits or 3 digits starting with 0-9.
70 * @returns {DateRegExBuilder} builder
71 * @constructor
72 */
73 YYYY(): DateRegExBuilder;
74 /**
75 * Add capture group for capturing 1 through 4 digits.
76 * @returns {DateRegExBuilder} builder
77 * @constructor
78 */
79 YYYY14(): DateRegExBuilder;
80 /**
81 * Add capture group for capturing 1 through 4 digits, in addition to any followed by one or more spaces.
82 * @returns {DateRegExBuilder} builder
83 * @constructor
84 */
85 YYYY14_W_SPACE(): DateRegExBuilder;
86 YYYY2_OR_4_W_SPACE(): DateRegExBuilder;
87 /**
88 * Add capture group for a flexible delimiter, including ", ", " ", ". ", "\", "-".
89 * @returns {DateRegExBuilder} builder
90 * @constructor
91 */
92 FLEX_DELIMITER(): DateRegExBuilder;
93 /**
94 * Add capture group for a flexible delimiter, including ", ", " ", ".", "\", "-". Different from FLEX_DELIMITER
95 * in that it will match periods with zero or more spaces on either side.
96 * For reference: https://regex101.com/r/q1fp1z/1/
97 * @returns {DateRegExBuilder} builder
98 * @constructor
99 */
100 FLEX_DELIMITER_LOOSEDOT(): DateRegExBuilder;
101 /**
102 * Add an optional capture group for capturing timestamps including: "10am", "10:10", "10:10pm", "10:10:10",
103 * "10:10:10am", along with zero or more spaces after semi colons, AM or PM, and unlimited number of digits per unit.
104 * @returns {DateRegExBuilder} builder
105 * @constructor
106 */
107 OPTIONAL_TIMESTAMP_CAPTURE_GROUP(): DateRegExBuilder;
108 /**
109 * Add a capture group for capturing timestamps including: "10am", "10:10", "10:10pm", "10:10:10",
110 * "10:10:10am", along with zero or more spaces after semi colons, AM or PM, and unlimited number of digits per unit.
111 * See https://regex101.com/r/0bmj5n/1/ for more information of 9-digit maximum. One series, "12:00001989198298am",
112 * has a maximum of 10 digits: "0*(?:[1-9]{1}[0-9]{0,9})?"
113 * @returns {DateRegExBuilder} builder
114 * @constructor
115 */
116 TIMESTAMP_UNITS_CAPTURE_GROUP(): DateRegExBuilder;
117 /**
118 * Build the regular expression and ignore case.
119 * @returns {RegExp}
120 */
121 build(): RegExp;
122}
123export { DateRegExBuilder };