Like tried with this sample with no special character:
let x = new RegExp('^[A-Za-z\s0-9]+$'); // with no special char
x.test('Hello world'); // should return true
x.test('Hello world with something'); // should return true
x.test(' Hello world'); // should return false
x.test('Hello world '); // should return false
x.test('Hello world'); // should return false