|
...
|
...
|
@@ -2205,11 +2205,17 @@ Handling Information |
|
|
|
.replace(/DIMS:\s*!/gi, '')
|
|
|
|
.replace(/VOL:\s*\d+(\.\d+)?\s*CBM/gi, '');*/
|
|
|
|
const cleanedValue = value
|
|
|
|
.replace(/^\s*DIMS?\s*[::]?\s*$/gim, '') // 删除仅包含 DIM 或 DIMS 的行(可带冒号)
|
|
|
|
.replace(/^\s*VOL\s*[::]\s*.*$/gim, '') // 删除整行 VOL 开头的行(含中英文冒号)
|
|
|
|
.replace(/^\s+|\s+$/g, '') // 去除每行首尾空白(可选)
|
|
|
|
.split('\n') // 按行分割
|
|
|
|
.filter(line => {
|
|
|
|
const trimmedLine = line.trim();
|
|
|
|
// 如果行为空,保留(或根据需求决定是否保留)
|
|
|
|
if (trimmedLine === '') return true;
|
|
|
|
// 如果包含 DIM 或 VOL(不区分大小写),则过滤掉(不保留)
|
|
|
|
return !/DIM|VOL/i.test(trimmedLine);
|
|
|
|
})
|
|
|
|
.join('\n') // 重新合并为字符串
|
|
|
|
.replace(/\n{2,}/g, '\n') // 合并多个空行为一个
|
|
|
|
.trim(); // 去掉首尾空行
|
|
|
|
.trim(); // 去掉首尾空行 // 去掉首尾空行
|
|
|
|
|
|
|
|
// 将剩余内容按行分割,并去除空行
|
|
|
|
const lines = cleanedValue.split('\n').filter(line => line.trim() !== '');
|
...
|
...
|
|