I have tried this code:
/[m,r,k]/
I want to check that the string contains all three characters, in this case m,r,k
. Order is not important.
I have tried this code:
/[m,r,k]/
I want to check that the string contains all three characters, in this case m,r,k
. Order is not important.
You can use
^(?=.*m)(?=.*r)(?=.*k).*$
let checkStr = (str) => /^(?=.*m)(?=.*r)(?=.*k).*$/i.test(str)
console.log(checkStr('mrk'))
console.log(checkStr('mr'))