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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
use Regex;
/// 火车车次
///
/// # Examples
///
/// ```
/// let train_number = String::from("G14");
/// let train_number_2 = String::from("G11234");
///
/// assert_eq!(regex_collection::common::is_train_number(&train_number), true);
/// assert_eq!(regex_collection::common::is_train_number(&train_number_2), false);
/// ```
/// 手机机身码(IMEI)
///
/// # Examples
///
/// ```
/// let imei = String::from("122457589068754");
/// let imei_2 = String::from("G11234");
///
/// assert_eq!(regex_collection::common::is_imei(&imei), true);
/// assert_eq!(regex_collection::common::is_imei(&imei_2), false);
/// ```
/// 网址
///
/// # Examples
///
/// ```
/// let url = String::from("http://baidu.com:8081");
/// let url_2 = String::from("http://baidu.com/asdf/#/234-123");
///
/// assert_eq!(regex_collection::common::is_url(&url), true);
/// assert_eq!(regex_collection::common::is_url(&url_2), true);
/// ```
/// 必须带端口号的网址(或ip)
///
/// # Examples
///
/// ```
/// let url = String::from("http://baidu.com:8081");
/// let url_2 = String::from("http://baidu.com");
///
/// assert_eq!(regex_collection::common::is_url_with_port(&url), true);
/// assert_eq!(regex_collection::common::is_url_with_port(&url_2), false);
/// ```
/// 统一社会信用代码
///
/// # Examples
///
/// ```
/// let url = String::from("9A1234568378908767");
/// let url_2 = String::from("http://baidu.com");
///
/// assert_eq!(regex_collection::common::is_unified_social_credit_code(&url), true);
/// assert_eq!(regex_collection::common::is_unified_social_credit_code(&url_2), false);
/// ```
/// 视频(video)链接地址(支持swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4格式)
///
/// # Examples
///
/// ```
/// let url = String::from("http://ASD.COM/asd/asd");
/// let url_2 = String::from("http://baidu.com/ewe.mov");
///
/// assert_eq!(regex_collection::common::is_video_url(&url), false);
/// assert_eq!(regex_collection::common::is_video_url(&url_2), true);
/// ```
/// 图片(video)链接地址(支持gif|png|jpg|jpeg|webp|svg|psd|bmp|tif格式)
///
/// # Examples
///
/// ```
/// let url = String::from("http://ASD.COM/asd/asd.psd");
/// let url_2 = String::from("https://baidu.com/ewe.jpg");
///
/// assert_eq!(regex_collection::common::is_image_url(&url), false);
/// assert_eq!(regex_collection::common::is_image_url(&url_2), true);
/// ```
/// base64格式
///
/// # Examples
///
/// ```
/// let text = String::from("http://ASD.COM/asd/asd.psd");
/// let text_2 = String::from("data:image/gif;base64,dsafasdfasddGhpcyBpcyBhIGV4YW1wbGU=");
///
/// assert_eq!(regex_collection::common::is_base64(&text), false);
/// assert_eq!(regex_collection::common::is_base64(&text_2), true);
/// ```
/// 银行卡号
///
/// # Examples
///
/// ```
/// let text = String::from("http://ASD.COM/asd/asd.psd");
/// let text_2 = String::from("data:image/gif;base64,dsafasdfasddGhpcyBpcyBhIGV4YW1wbGU=");
///
/// assert_eq!(regex_collection::common::is_credit_card_numbers(&text), false);
/// assert_eq!(regex_collection::common::is_credit_card_numbers(&text_2), true);
/// ```