1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Functions for the empty matches
use HumanRegex;
/// A function to match a word boundary
/// A function to match anything BUT a word boundary
/// A function to match the beginning of text (or start-of-line with multi-line mode)
/// ```
/// use human_regex::{beginning, text};
/// let regex_string = beginning() + text("hex");
/// assert!(regex_string.to_regex().is_match("hexagon"));
/// assert!(!regex_string.to_regex().is_match("chlorhexadine"));
/// ```
/// A function to match the end of text (or end-of-line with multi-line mode)
/// ```
/// use human_regex::{end, text};
/// let regex_string = text("end") + end();
/// assert!(regex_string.to_regex().is_match("mend"));
/// assert!(!regex_string.to_regex().is_match("endocrinologist"));
/// ```
/// A function to match the beginning of text (even with multi-line mode enabled)
/// ```
/// use human_regex::{beginning_of_text, text};
/// let regex_string = beginning_of_text() + text("hex");
/// assert!(regex_string.to_regex().is_match("hexagon"));
/// assert!(!regex_string.to_regex().is_match("chlorhexadine"));
/// ```
/// A function to match the end of text (even with multi-line mode enabled)
/// ```
/// use human_regex::{end_of_text, text};
/// let regex_string = text("end") + end_of_text();
/// assert!(regex_string.to_regex().is_match("mend"));
/// assert!(!regex_string.to_regex().is_match("endocrinologist"));
/// ```