const regex = new RegExp('((?<A>\\s(greater|less|earlier)\\sth[a|e]n)((?<B>\\sor equal)[s]?)?(\\sto)?\\s)(?<V>[^\\s]+)?', 'gm')
const str = `Check if the version of xpsviewer.exe is greater than or equal to 3.0.6920.7000
Check if OpenSSL 1.1.0 version is greater than or equal 1.1.0 and less than 1.1.0e
Check if Oracle VM VirtualBox version is greater than or equals to 3.2.0
Version of VLC Media Player less than or equal to 2.0.4
Check if Java SE Development Kit 1.6 version is less than or equal 6.0.1710
Version of VLC Media Player greater than or equal to 0.5.0 and less than or equal to 0.9.5
the version of cryptdlg.dll is less then 5.0.1558.6072
Check if the version of Microsoft.sqlserver.chainer.infrastructure.dll is less than 14.0.2000.63 and greater than 14.0.0
Check if OpenSSL version is less than or equals to 0.9.8.24 in VisualSVN Server
Determine if the version of JavaFX is less than 2.2.46 (JRE 1.7.0:update_6 and later)
Mozilla Firefox ESR version is less than 24.1 and greater than or equal to 24.x
Check if SQL Server instances with version less than 2009.100.4000.0 and greater than or equal 2009.100.2500.0
Excel 2000 SP3 or greater is installed
Mozilla Firefox version 3.5.x to 3.5.1 or less than 3.0.14
Check if ssleay32.dll 1.0.1 version is greater than or equal 1.0.1 and less than 1.0.1u on ProgramFilesDir (x86)
Check if SQL Server instances with version greater than or equal 2007.100.6000.0 and less than 2009.100.1600.1 exist
Check if outlook.exe version is greater than or equal to 16.0.8201.0000 and less than 16.0.8201.2213 (MSO 2016 Version 1705)
firefox DPKG is earlier than 0:32.0+build1-0ubuntu0.12.04.1
openjdk-7-jre-headless DPKG is earlier than 0:7u65-2.5.1-4ubuntu1~0.14.04.1
kvm DPKG is earlier than 84+dfsg-0ubuntu16+0.12.3+noroms+0ubuntu9.4
Check if the version of ssleay32.dll 0.9.1c before 0.9.8y ProgramFilesDir x86
Check if the version of OpenSSL 0.9.1c before 0.9.8s (32_bit)
Version of Wireshark is 1.4.x before 1.4.15, 1.6.x before 1.6.10, or 1.8.x before 1.8.2
Version of Wireshark is 1.8.x before 1.8.10 or 1.10.x before 1.10.2
Check if the version of PHP is less than 5.2.15 or 5.3.x before 5.3.4
`;
// 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