参考文献格式
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user