javascript - Regex - I want my string to end with 2 special character -
i've been trying make regex ends 2 special characters, couldnt find solution. here tried, seems not working.
/.[!@#$%^&*]{2}+$/; thanks in advance.
try regex:
^.*[!@#$%^&*]{2}$ const regex = /^.*[!@#$%^&*]{2}$/; const str = `abc@#\$`; let m; if(str.match(regex)) { console.log("matched"); } else console.log("not matched");
Comments
Post a Comment