update regex catch special version

This commit is contained in:
joseph le 2023-11-29 08:19:10 +07:00
parent 6022621b44
commit b1864b02a8
1 changed files with 34 additions and 35 deletions

View File

@ -1,15 +1,14 @@
import Env from "@ioc:Adonis/Core/Env"; import Env from "@ioc:Adonis/Core/Env";
import fs from "fs"; import KeyValue from "App/Models/KeyValue";
import chokidar from "chokidar";
import moment from "moment";
import LogDetectFile from "App/Models/LogDetectFile"; import LogDetectFile from "App/Models/LogDetectFile";
import LogReport from "App/Models/LogReport"; import LogReport from "App/Models/LogReport";
import KeyValue from "App/Models/KeyValue"; import chokidar from "chokidar";
import Database from "@ioc:Adonis/Lucid/Database"; import fs from "fs";
import { sendMessToZulip } from "./sendMessToZulip";
import { getListLineByItem } from "./getListLineByItem";
import { checkIndexSN } from "./checkIndexSN";
import { DateTime } from "luxon"; import { DateTime } from "luxon";
import moment from "moment";
import { checkIndexSN } from "./checkIndexSN";
import { getListLineByItem } from "./getListLineByItem";
import { sendMessToZulip } from "./sendMessToZulip";
export async function runtimeCheckLogs(folderPath) { export async function runtimeCheckLogs(folderPath) {
try { try {
let fileList = Array(); let fileList = Array();
@ -36,11 +35,11 @@ export async function runtimeCheckLogs(folderPath) {
const checkSpecialVersion = (paragraph) => { const checkSpecialVersion = (paragraph) => {
try { try {
const regex = /\(CAT3K_CAA-UNIVERSALK9-M\), Version 16\.9\.[2-9]/; const regex = /\(CAT[1-9]K.*Version 16\.9\.[2-9]/;
const regex1 = const regex1 =
/\(CAT3K_CAA-UNIVERSALK9-M\), Version 1[7-9]\.[0-9]\.[0-9]/; /\(CAT[1-9]K.*Version 1[7-9]\.[0-9]\.[0-9]/;
const regex2 = const regex2 =
/\(CAT3K_CAA-UNIVERSALK9-M\), Version [2-9][0-9]\.[0-9]\.[0-9]/; /\(CAT[1-9]K.*Version [2-9][0-9]\.[0-9]\.[0-9]/;
// Use the regular expression to find the match // Use the regular expression to find the match
const match = paragraph.match(regex); const match = paragraph.match(regex);
const match1 = paragraph.match(regex1); const match1 = paragraph.match(regex1);