SyntaxFix
Write A Post
Hire A Developer
Questions
This will do:
/^(apple|banana)$/
to exclude from captured strings (e.g. $1,$2):
$1
$2
(?:apple|banana)