easy_regex/settings/
base.rs

1//! Collection of static Settings.
2//! 
3//! These are adjusted **base settings** to be used in methods like [`literal`](../../struct.EasyRegex.html#method.literal) to save time and make the code more readable.
4
5use crate::settings::{Settings, Flags};
6
7lazy_static! {
8    pub static ref DEFAULT: Settings = Settings {
9        is_optional: false,
10        is_one_or_more: false,
11        is_nil_or_more: false,
12        is_optional_ungreedy: false,
13        with_left_boundary: false,
14        with_left_non_boundary: false,
15        with_right_boundary: false,
16        with_right_non_boundary: false,
17        range: None,
18        exactly: None,
19        flags: None
20    };
21    pub static ref OPTIONAL: Settings = Settings {
22        is_optional: true,
23        is_one_or_more: false,
24        is_nil_or_more: false,
25        is_optional_ungreedy: false,
26        with_left_boundary: false,
27        with_left_non_boundary: false,
28        with_right_boundary: false,
29        with_right_non_boundary: false,
30        range: None,
31        exactly: None,
32        flags: None
33    };
34    pub static ref OPTIONAL_UNGREEDY: Settings = Settings {
35        is_optional: false,
36        is_optional_ungreedy: true,
37        is_one_or_more: false,
38        is_nil_or_more: false,
39        with_left_boundary: false,
40        with_left_non_boundary: false,
41        with_right_boundary: false,
42        with_right_non_boundary: false,
43        range: None,
44        exactly: None,
45        flags: None
46    };
47    pub static ref ONE_OR_MORE: Settings = Settings {
48        is_optional: false,
49        is_one_or_more: true,
50        is_nil_or_more: false,
51        is_optional_ungreedy: false,
52        with_left_boundary: false,
53        with_left_non_boundary: false,
54        with_right_boundary: false,
55        with_right_non_boundary: false,
56        range: None,
57        exactly: None,
58        flags: None
59    };
60    pub static ref ONE_OR_MORE_UNGREEDY: Settings = Settings {
61        is_optional: true,
62        is_one_or_more: true,
63        is_nil_or_more: false,
64        is_optional_ungreedy: false,
65        with_left_boundary: false,
66        with_left_non_boundary: false,
67        with_right_boundary: false,
68        with_right_non_boundary: false,
69        range: None,
70        exactly: None,
71        flags: None
72    };
73    pub static ref NIL_OR_MORE: Settings = Settings {
74        is_optional: false,
75        is_one_or_more: false,
76        is_nil_or_more: true,
77        is_optional_ungreedy: false,
78        with_left_boundary: false,
79        with_left_non_boundary: false,
80        with_right_boundary: false,
81        with_right_non_boundary: false,
82        range: None,
83        exactly: None,
84        flags: None
85    };
86    pub static ref NIL_OR_MORE_UNGREEDY: Settings = Settings {
87        is_optional: true,
88        is_one_or_more: false,
89        is_nil_or_more: true,
90        is_optional_ungreedy: false,
91        with_left_boundary: false,
92        with_left_non_boundary: false,
93        with_right_boundary: false,
94        with_right_non_boundary: false,
95        range: None,
96        exactly: None,
97        flags: None
98    };
99    pub static ref LEFT_BOUNDARY: Settings = Settings {
100        is_optional: false,
101        is_one_or_more: false,
102        is_nil_or_more: false,
103        is_optional_ungreedy: false,
104        with_left_boundary: true,
105        with_left_non_boundary: false,
106        with_right_boundary: false,
107        with_right_non_boundary: false,
108        range: None,
109        exactly: None,
110        flags: None
111    };
112    pub static ref RIGHT_BOUNDARY: Settings = Settings {
113        is_optional: false,
114        is_one_or_more: false,
115        is_nil_or_more: false,
116        is_optional_ungreedy: false,
117        with_left_boundary: false,
118        with_left_non_boundary: false,
119        with_right_boundary: true,
120        with_right_non_boundary: false,
121        range: None,
122        exactly: None,
123        flags: None
124    };
125    pub static ref BOTH_BOUNDARY: Settings = Settings {
126        is_optional: false,
127        is_one_or_more: false,
128        is_nil_or_more: false,
129        is_optional_ungreedy: false,
130        with_left_boundary: true,
131        with_left_non_boundary: false,
132        with_right_boundary: true,
133        with_right_non_boundary: false,
134        range: None,
135        exactly: None,
136        flags: None
137    };
138    pub static ref LEFT_NON_BOUNDARY: Settings = Settings {
139        is_optional: false,
140        is_one_or_more: false,
141        is_nil_or_more: false,
142        is_optional_ungreedy: false,
143        with_left_boundary: false,
144        with_left_non_boundary: true,
145        with_right_boundary: false,
146        with_right_non_boundary: false,
147        range: None,
148        exactly: None,
149        flags: None
150    };
151    pub static ref RIGHT_NON_BOUNDARY: Settings = Settings {
152        is_optional: false,
153        is_one_or_more: false,
154        is_nil_or_more: false,
155        is_optional_ungreedy: false,
156        with_left_boundary: false,
157        with_left_non_boundary: false,
158        with_right_boundary: false,
159        with_right_non_boundary: true,
160        range: None,
161        exactly: None,
162        flags: None
163    };
164    pub static ref BOTH_NON_BOUNDARY: Settings = Settings {
165        is_optional: false,
166        is_one_or_more: false,
167        is_nil_or_more: false,
168        is_optional_ungreedy: false,
169        with_left_boundary: false,
170        with_left_non_boundary: true,
171        with_right_boundary: false,
172        with_right_non_boundary: true,
173        range: None,
174        exactly: None,
175        flags: None
176    };
177    pub static ref INSENSITIVE: Settings = Settings {
178        is_optional: false,
179        is_one_or_more: false,
180        is_nil_or_more: false,
181        is_optional_ungreedy: false,
182        with_left_boundary: false,
183        with_left_non_boundary: false,
184        with_right_boundary: false,
185        with_right_non_boundary: false,
186        range: None,
187        exactly: None,
188        flags: Some(Flags::Insensitive),
189    };
190    pub static ref MULTILINE: Settings = Settings {
191        is_optional: false,
192        is_one_or_more: false,
193        is_nil_or_more: false,
194        is_optional_ungreedy: false,
195        with_left_boundary: false,
196        with_left_non_boundary: false,
197        with_right_boundary: false,
198        with_right_non_boundary: false,
199        range: None,
200        exactly: None,
201        flags: Some(Flags::Multiline),
202    };
203    pub static ref DOT_MATCH_NEWLINE: Settings = Settings {
204        is_optional: false,
205        is_one_or_more: false,
206        is_nil_or_more: false,
207        is_optional_ungreedy: false,
208        with_left_boundary: false,
209        with_left_non_boundary: false,
210        with_right_boundary: false,
211        with_right_non_boundary: false,
212        range: None,
213        exactly: None,
214        flags: Some(Flags::DotMatchNewLine),
215    };
216    pub static ref IGNORE_WHITESPACE: Settings = Settings {
217        is_optional: false,
218        is_one_or_more: false,
219        is_nil_or_more: false,
220        is_optional_ungreedy: false,
221        with_left_boundary: false,
222        with_left_non_boundary: false,
223        with_right_boundary: false,
224        with_right_non_boundary: false,
225        range: None,
226        exactly: None,
227        flags: Some(Flags::IgnoreWhitespace),
228    };
229    pub static ref SENSITIVE: Settings = Settings {
230        is_optional: false,
231        is_one_or_more: false,
232        is_nil_or_more: false,
233        is_optional_ungreedy: false,
234        with_left_boundary: false,
235        with_left_non_boundary: false,
236        with_right_boundary: false,
237        with_right_non_boundary: false,
238        range: None,
239        exactly: None,
240        flags: Some(Flags::Sensitive),
241    };
242    pub static ref SINGLE_LINE: Settings = Settings {
243        is_optional: false,
244        is_one_or_more: false,
245        is_nil_or_more: false,
246        is_optional_ungreedy: false,
247        with_left_boundary: false,
248        with_left_non_boundary: false,
249        with_right_boundary: false,
250        with_right_non_boundary: false,
251        range: None,
252        exactly: None,
253        flags: Some(Flags::SingleLine),
254    };
255    pub static ref DOT_DISMATCH_NEWLINE: Settings = Settings {
256        is_optional: false,
257        is_one_or_more: false,
258        is_nil_or_more: false,
259        is_optional_ungreedy: false,
260        with_left_boundary: false,
261        with_left_non_boundary: false,
262        with_right_boundary: false,
263        with_right_non_boundary: false,
264        range: None,
265        exactly: None,
266        flags: Some(Flags::DotDisMatchNewLine),
267    };
268    pub static ref INCLUDE_WHITESPACE: Settings = Settings {
269        is_optional: false,
270        is_one_or_more: false,
271        is_nil_or_more: false,
272        is_optional_ungreedy: false,
273        with_left_boundary: false,
274        with_left_non_boundary: false,
275        with_right_boundary: false,
276        with_right_non_boundary: false,
277        range: None,
278        exactly: None,
279        flags: Some(Flags::IncludeWhitespace),
280    };
281}