mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
feat(parser): improve names regex to exclude some non-standard cases
Like "Название ФАмилия. И.О.". In that case regex will grab "Название ФА", instead of "Амилия. И. О." (we can't add 'Ф', bc it will make regex checks way more complex). Now it will ignore "Название ФА" if after that lower or upper char is placed. Previously only lower chars are excluded and check won't exclude "Название ФА" and grabs "Название Ф" bc after 'Ф' uppercase char is present.
This commit is contained in:
@@ -377,7 +377,7 @@ fn parse_name_and_subgroups(text: &str, row: u32, column: u32) -> Result<ParsedL
|
||||
// Регулярное выражение для получения ФИО преподавателей и номеров подгрупп (aka. второй части).
|
||||
static NAME_RE: LazyLock<fancy_regex::Regex> = LazyLock::new(|| {
|
||||
fancy_regex::Regex::new(
|
||||
r"([А-Я][а-я]+(?:[\s.]*[А-Я]){1,2})(?=[^а-я])[.\s]*(?:\(?(\d)[\sа-я]*\)?)?",
|
||||
r"([А-Я][а-я]+(?:[\s.]*[А-Я]){1,2})(?=[^А-Яа-я])[.\s]*(?:\(?(\d)[\sа-я]*\)?)?",
|
||||
)
|
||||
.unwrap()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user