Skip to content

Commit 96c1fb2

Browse files
committed
Regex has been fixed
1 parent f0fae32 commit 96c1fb2

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/parser.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ use regex::Regex;
44
pub fn is_tiktok_url(message: &str) -> bool {
55
lazy_static! {
66
static ref RE: Regex = Regex::new(
7-
r"(?ix)^https?://
8-
(?:www\.|m\.|vm\.)? # Subdomain
9-
tiktok\.com/
10-
(?: # Path options:
11-
@[\w-]+/video/\d+ # Standard format with video
12-
| t/\d+ # Format with /t/
13-
| \w+ # Short ID for VM
14-
)
15-
/?$ # Optional finishing slash"
7+
r"(?ix)^(https?://)?\w{2,3}\.tiktok\.com/.+"
168
).unwrap();
179
}
1810
RE.is_match(message)

0 commit comments

Comments
 (0)