参考文献格式

This commit is contained in:
wangjinlei
2026-08-05 18:36:17 +08:00
parent 2db6f170fe
commit d72b16d9e8
7 changed files with 563 additions and 112 deletions

View File

@@ -2824,7 +2824,8 @@ class Production extends Base
];
// 匹配模式year;volume(number):pages
$pattern = '/(\d{4})\s*;\s*(\d+)(?:\(([^)]+)\))?(?:\s*:\s*([a-zA-Z0-9\u2013\u2014\-]+(?:\s*[\u2013\u2014\-]\s*[a-zA-Z0-9]+)?))?/';
// PCRE 不认 \uXXXX会当成字面量 u页码连接符须写成 \x{2013} 并加 u 修饰符
$pattern = '/(\d{4})\s*;\s*(\d+)(?:\(([^)]+)\))?(?:\s*:\s*([a-zA-Z0-9]+(?:\s*[\x{2013}\x{2014}\x{2212}-]\s*[a-zA-Z0-9]+)?))?/u';
if (preg_match($pattern, $referenceText, $matches)) {
@@ -2863,7 +2864,7 @@ class Production extends Base
}
// 提取卷号和期号(格式如 54(4) 或 54 (4)
if (preg_match('/(\d+)\s*\(?(\d*)\)?\s*:?\s*([a-zA-Z0-9\-]*)/', $referenceText, $volMatches)) {
if (preg_match('/(\d+)\s*\(?(\d*)\)?\s*:?\s*([a-zA-Z0-9\x{2013}\x{2014}\x{2212}-]*)/u', $referenceText, $volMatches)) {
if (isset($volMatches[1])) {
$result['volume'] = $volMatches[1];
}