Seems quite simple, but I can't find how to do this. I want to match a single character within a certain range, say a to z.
[a-z]
Currently doing the following:
const regex = RegExp('[a-z]');
console.warn('TEST', regex.test('a'))
Simple enough. However I want it to be a single character. If there is any more than one, regardless if they also belong in that range, it needs to fail. So for example:
a
should passb
should passab
should failaa
should failabcdefg
should fail
You get the idea.
I have tried some variations such asL
[{1}a-z]
Which doesn't do anything. Ultimately it still accepts any combination of character within that range.