Skip to content

Commit fa749fe

Browse files
committed
bibtext regexp ambiguous
1 parent 2ffe67f commit fa749fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/somef/utils/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
REGEXP_COLAB = "https://colab.research.google.com/drive"
2626
# needed to cleanup bibtext files.
2727
# REGEXP_BIBTEX = r'\@[a-zA-Z]+\{[.\n\S\s]+?[author|title][.\n\S\s]+?[author|title][.\n\S\s]+?\n\}'
28-
REGEXP_BIBTEX = r'@[a-zA-Z]+\{[\s\S]*?(?:author|title)[\s\S]*?(?:author|title)[\s\S]*?\}'
29-
28+
# REGEXP_BIBTEX = r'@[a-zA-Z]+\{[\s\S]*?(?:author|title)[\s\S]*?(?:author|title)[\s\S]*?\}'
29+
REGEXP_BIBTEX = r'@[a-zA-Z]+\{(?=[\s\S]*\bauthor\b)(?=[\s\S]*\btitle\b)[\s\S]*?\}'
3030
REGEXP_DOI = r'\[\!\[DOI\]([^\]]+)\]\(([^)]+)\)'
3131
REGEXP_LINKS = r"\[(.*?)?\]\(([^)]+)\)"
3232
REGEXP_IMAGES = r"!\[(.*?)?\]\((.*?)?\)"

0 commit comments

Comments
 (0)