diff --git a/bibtexparser/customization.py b/bibtexparser/customization.py index 3e7447d1..b72f7caf 100644 --- a/bibtexparser/customization.py +++ b/bibtexparser/customization.py @@ -345,7 +345,8 @@ def author(record): """ if "author" in record: if record["author"]: - record["author"] = getnames([i.strip() for i in record["author"].replace('\n', ' ').split(" and ")]) + record["author"] = getnames([i.strip() for i in re.split(r"\ and\ ", record["author"].replace('\n', ' '), + flags=re.IGNORECASE)]) else: del record["author"] return record diff --git a/bibtexparser/tests/data/book_capital_AND.bib b/bibtexparser/tests/data/book_capital_AND.bib new file mode 100644 index 00000000..afd444d6 --- /dev/null +++ b/bibtexparser/tests/data/book_capital_AND.bib @@ -0,0 +1,8 @@ +@BOOK{Bird1987, + title = {Dynamics of Polymeric Liquid}, + publisher = {Wiley Edition}, + year = {1987}, + author = {Bird, R.B. and Armstrong, R.C. AND Hassager, O.}, + volume = {1}, + edition = {2}, +} diff --git a/bibtexparser/tests/test_bparser.py b/bibtexparser/tests/test_bparser.py index dd6f6e13..8e04f3e0 100644 --- a/bibtexparser/tests/test_bparser.py +++ b/bibtexparser/tests/test_bparser.py @@ -398,7 +398,7 @@ def test_book(self): self.assertEqual(res, expected) def test_book_cust_unicode(self): - with open('bibtexparser/tests/data/book.bib', 'r') as bibfile: + with open('bibtexparser/tests/data/book_capital_AND.bib', 'r') as bibfile: bib = BibTexParser(bibfile.read(), customization=customizations_unicode) res = bib.get_entry_list() expected = [{'ENTRYTYPE': 'book',