$regex(%text,/(?:\s|^)(by|apple|orange)(?:\s|$)/i)

Will match one of those three words (by, apple, orange) as long as it is surrounded by a space character (space, tab) or the beginning or end of the string.

-genius_at_work