use lazy_static::lazy_static;
use fancy_regex::Regex;
use crate::regextra::fregex;
const CLASS_RE_S: &str = r"(?:\([^)\n]+\))"; const STYLE_RE_S: &str = r"(?:\{[^}\n]+\})"; const LANGUAGE_RE_S: &str = r"(?:\[[^\]\n]+\])"; pub(crate) const SNIP_ACR: &str = r"\p{Lu}\p{Nd}";
pub(crate) const SNIP_DIGIT: &str = r"\p{N}";
pub(crate) const SNIP_SPACE: &str = r"\s";
pub(crate) const SNIP_WRD: &str = r"(?:\p{L}|\p{M}|\p{N}|\p{Pc})";
pub(crate) const SNIP_CUR: &str = r"\p{Currency_Symbol}";
pub(crate) const SNIP_CHAR: &str = r"\S";
pub(crate) const VALIGN_RE_S: &str = r"[\-^~]";
pub(crate) const HALIGN_RE_S: &str = r"(?:\<(?!>)|(?<!<)\>|\<\>|\=|[()]+(?! ))";
pub(crate) const UPPER_CHARS: &str = r"\p{Lu}";
pub(crate) const SNIP_ABR: &str = UPPER_CHARS;
pub(crate) const PNCT_RE_S: &str = r##"[-!"#$%&()*+,/:;<=>?@\'\[\\\]\.^_`{|}~]"##;
pub(crate) const BLOCK_CONTENT: &str = concat!(
"address|article|aside|blockquote|details|div|dl|fieldset|figure|figcaption",
"|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|main|menu|nav|ol",
"|pre|p|section|s|table|template|ul");
lazy_static! {
pub(crate) static ref CLS_RE_S: String = format!(
concat!(r"(?:",
r"{c}(?:{l}(?:{s})?|{s}(?:{l})?)?|",
r"{l}(?:{c}(?:{s})?|{s}(?:{c})?)?|",
r"{s}(?:{c}(?:{l})?|{l}(?:{c})?)?",
r")?"),
c=CLASS_RE_S, s=STYLE_RE_S, l=LANGUAGE_RE_S);
pub(crate) static ref ALIGN_RE_S: String = format!(r"(?:{0}|{1})*", HALIGN_RE_S, VALIGN_RE_S);
pub(crate) static ref LONE_AMP_RE: Regex = fregex!(r"(?i)&(?!#[0-9]+;|#x[a-f0-9]+;|[a-z][a-z0-9]*;)");
pub(crate) static ref DIVIDER_RE: Regex = fregex!(
r"(?si)^(?:</?(br|hr|img)(?:\s[^<>]*?|/?)>(?:</\1\s*?>)?)+$");
}