I'm wanting to match a list of words which is easy enough when those words are truly words. For example /\b (pop|push) \b/gsx
when ran against the string
pop gave the door a push but it popped back
will match the words pop and push but not popped.
I need similar functionality for words that contain characters that would normally qualify as word boundaries. So I need /\b (reverse!|push) \b/gsx
when ran against the string
push reverse! reverse!push
to only match reverse! and push but not match reverse!push. Obviously this regex isn't going to do that so what do I need to use instead of \b to make my regex smart enough to handle these funky requirements?