$str = "this here and that or those there and his or hers nor thee"; @words = split /\h*\b(and|nor|or)\b\h*/, $str;