feat: match single/double/tick quoted strings

This commit is contained in:
graelo 2021-03-27 16:23:27 +01:00
parent eaeaf5268b
commit 12c47d1584
3 changed files with 42 additions and 2 deletions

View file

@ -10,8 +10,8 @@ pub(super) const EXCLUDE_PATTERNS: [(&str, &str); 1] =
/// Holds all the regex patterns that are currently supported.
///
/// The email address was obtained at https://www.regular-expressions.info/email.html.
/// Others were obtained from Ferran Basora.
pub(super) const PATTERNS: [(&str, &str); 17] = [
/// Some others were obtained from Ferran Basora, the rest is by me.
pub(super) const PATTERNS: [(&str, &str); 20] = [
("markdown-url", r"\[[^]]*\]\(([^)]+)\)"),
(
"url",
@ -40,6 +40,9 @@ pub(super) const PATTERNS: [(&str, &str); 17] = [
"datetime",
r"(\d{4}-?\d{2}-?\d{2}([ T]\d{2}:\d{2}:\d{2}(\.\d{3,9})?)?)",
),
("quoted-single", r#"'([^']+)'"#),
("quoted-double", r#""([^"]+)""#),
("quoted-tick", r#"`([^`]+)`"#),
("digits", r"([0-9]{4,})"),
];