I have an input that can have only 2 values apple
or banana
. What regular expression can I use to ensure that either of the two words was submitted?
This question is related to
regex
forms
validation
There are different regex engines but I think most of them will work with this:
apple|banana
Source: Stackoverflow.com