SyntaxFix
Write A Post
Hire A Developer
Questions
Write your regex differently:
var r = /^a$/; r.test('a'); // true r.test('ba'); // false