I want to check if a string matches only some characters with a regex.
For example, I would like to match only a
, b
, or c
.
So, "aaacb" would pass, but "aaauccb" would not (because of the u
).
I have tried this way:
/[a|b|c]+/
but it does not work, because the failing example passes.