I just want to match by|apple|orange It should only be one of those word and nothing else before or after the letters, what is the right regex for this?
I think you asked the same question before. read this thread all you have to do is to remove the \. and insert your words.
Tried that, but it didnt work, it will only match apple if its starts with it w/o anything before but if it is followed by other words or dots it will also match and it shouldnt
His pattern have same problem as yours but both ways, add a dot or a dot after "by", like $regex(by., or $regex(.by, and it will also match and I dont want that..
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.