const regex = /\b[AZQ]\d{10,14}(>\S+).*?(First Time : \d\d:\d\d[AP]M)/gms;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('\\b[AZQ]\\d{10,14}(>\\S+).*?(First Time : \\d\\d:\\d\\d[AP]M)', 'gms')
const str = `qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,qgvv]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',<€~Z1234566789>Z12345667890
1'fncnr'qmtjcsmsj194&(\$.!:!
,\$/&15?'?'(''(('(''158,\$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4\$,!;(\$qmfjccn1'fkfkckcqtngcnnq
AAABBB : ,\$2\$\$(&158((&&,&,&;&(&&((&
qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,€]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',<€~A1234566789>A1234566789123
1'fncnr'qmtjcsmsj194&(\$.!:!
,\$/&15?'?'(''(('(''158,\$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4\$,!;(\$qmfjccn1'fkfkckcqtngcnnq
AAABBB : :&;&;&(&;'1(&?&,&,&1&(&(,
\$2\$\$(&158((&&,&,&;&(&&((&;&;&;&;&
qitjfjdjqkfjjf 1934848[*{*}*}*#*#*#[#*
]*,€]*?£[£?£,£~'_!~£[££<£<'<'?£]!<!<
['~£,'}'<',!']'',',cjejfnfn<€~Q1234566789>Q123456678912
1'fncnr'qmtjcsmsj194&(\$.!:!
,\$/&15?'?'(''(('(''158,\$3,!!1
1'('(',';?1!( First Time : 10:10PM
1&4\$,!;(\$qmfjccn1'fkfkckcqtngcnnq
dbxbxne AAABBB : ,\$2\$\$(&158((&&,&,&;&(&&((&`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions