I am using below JavaScript code to check whether the given REGEX is matching with String or not by using test method.
const str = 'AUGUST PRODUCT UPDATES AND NEWSLETTER';
const regex = new RegExp('.*INAWS.*|.*INAWS P4.*|.*INAWSP4.*|.*P4 INAWS.*|.*P4INAWS.*|.*INAWS P3.*|.*INAWSP3.*|.*P3 INAWS.*|.*P3INAWS.*|.*INAWS P2.*|.*INAWSP2.*|.*P2 INAWS.*|.*P2INAWS.*|.*INAWS P1.*|.*INAWSP1.*|.*P1 INAWS.*|.*P1INAWS.*|.*INSAP.*|.*INSAP P4.*|.*INSAPP4.*|.*P4 INSAP.*|.*P4INSAP.*|.*INSAP P3.*|.*INSAPP3.*|.*P3 INSAP.*|.*P3INSAP.*|.*INSAP P2.*|.*INSAPP2.*|.*P2 INSAP.*|.*P2INSAP.*|.*INSAP P1.*|.*INSAPP1.*|.*P1 INSAP.*|.*P1INSAP.*|.*INFW.*|.*INFW P4.*|.*INFWP4.*|.*P4 INFW.*|.*P4INFW.*|.*INFW P3.*|.*INFWP3.*|.*P3 INFW.*|.*P3INFW.*|.*INFW P2.*|.*INFWP2.*|.*P2 INFW.*|.*P2INFW.*|.*.*|.*INFW P1.*|.*INFWP1.*|.*P1 INFW.*|.*P1INFW.*|.*INSEC.*|.*INSEC P4.*|.*INSECP4.*|.*P4 INSEC.*|.*P4INSEC.*|.*INSEC P3.*|.*INSECP3.*|.*P3 INSEC.*|.*P3INSEC.*|.*INSEC P2.*|.*INSECP2.*|.*P2 INSEC.*|.*P2INSEC.*|.*INSEC P1.*|.*INSECP1.*|.*P1 INSEC.*|.*P1INSEC.*');
console.log(regex.test(str));
The above code returns true ,
But i don't know which REGEX keyword is matching with above given String. I hope there is none of keyword is matched with given String, but don't know why it returns true.
Can anyone please help me to find out which REGEX is matching or I'm misunderstanding anything wrong since I'm newbie in Javascript?
.*.*that matches