diff --git "a/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.js" "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.js" index 9f5a28ef..5c24625d 100644 --- "a/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.js" +++ "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.js" @@ -4,7 +4,8 @@ export function get (data) { let json = JSON.parse(data); // 尾号1054卡1月5日15:00收入(退款支付宝-支付宝-消费)3.70元,余额1,108.67元。 // 尾号1054卡1月12日15:56支出(消费支付宝-谢水生)4元,余额873.02元。 - let regex = /尾号(\d{4})卡(\d{1,2}月\d{1,2}日\d{1,2}:\d{1,2})(.*?)\(([^)]+)\)(.*?)元,余额/; + // 尾号9301卡1月18日16:00支出(缴费财付通-北京科技大学)5元。 + let regex = /尾号(\d{4})卡(\d{1,2}月\d{1,2}日\d{1,2}:\d{1,2})(.*?)\(([^)]+)\)(.*?)元(?:,余额)?/; const match = json.text.match(regex); if (!match) { return null; diff --git "a/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.test.js" "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.test.js" index c0bb53ff..fdcef12a 100644 --- "a/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.test.js" +++ "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/main.test.js" @@ -1,3 +1,4 @@ + const { get } = require('./main'); const { testAnkio, testAnkioInit } = require('../../../../tests/TestUtils'); const { formatDate } = require('common/Time.js'); @@ -32,6 +33,19 @@ test('工商银行支出', () => 'currency': 'CNY', 'time': formatDate('1月12日15:56', 'M月D日h:i'), 'channel': '工商银行[支出]' + }, + { + 'type': 'Expend', + 'money': 5, + 'fee': 0, + 'shopName': '缴费财付通', + 'shopItem': '北京科技大学', + 'accountNameFrom': '工商银行(9301)', + 'accountNameTo': '', + 'currency': 'CNY', + 'time': formatDate('1月18日16:00', 'M月D日h:i'), + 'channel': '工商银行[支出]' } ])); + diff --git "a/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/tests/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\257\345\207\2722.txt" "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/tests/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\257\345\207\2722.txt" new file mode 100644 index 00000000..59dd4802 --- /dev/null +++ "b/src/rule/com.icbc/notice/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\266\346\224\257/tests/\345\267\245\345\225\206\351\223\266\350\241\214\346\224\257\345\207\2722.txt" @@ -0,0 +1 @@ +{"title":"动账通知","text":"尾号9301卡1月18日16:00支出(缴费财付通-北京科技大学)5元。","t":1737187216121} \ No newline at end of file