diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/parser.rb b/parser.rb index adaad3e..ab5ba2b 100644 --- a/parser.rb +++ b/parser.rb @@ -1,3 +1,5 @@ def word_in_string?(word, string) # implement with your code here + word_regex = /(#{word}[^a-zA-Z]+.*|.*[^a-zA-Z]+#{word}|^#{word}$)/ + string =~ word_regex ? :yes : :no end