I confess at the outset that I dislike and don’t really understand regex properly. I want to check that a single character ch is one of a set of acceptable characters. I thought this should work, but it doesn’t:
if (/aCcehIikmNnOoprSstxYy/.test(ch)) {
What am I doing wrong?
Thanks.
I think this can be solved without regex:
String.indexOf() returns -1 if character is not in string, otherwise positive number.