Your expression does not need. * and should not have $
'/^([a-zA-Z])/'
In fact, if you donβt need to know what this letter is, you can go even easier:
'/^[a-zA-Z]/'
/^[a-zA-Z]/.test("Sample text")
var re = new RegExp('^[a-zA-Z]');
re.test('Sample text');
source
share