For natural language processing (so that, for example, apostrophes are included in words), use instead \b{wb}

"don't" =~ / .+? \b{wb} /x; # matches the whole string