let b = 'A B C D' const parttern = new RegExp('[^'+b+']'); parttern.test('A') //false parttern.test('F') //true