From c0dd90a78c249b33575c0f2d13721fea92ef1159 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Wed, 10 Jul 2024 11:17:25 -0400 Subject: [PATCH 1/3] First three methods --- lib/regex_lab.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/regex_lab.rb b/lib/regex_lab.rb index 60552abf..5652ba03 100644 --- a/lib/regex_lab.rb +++ b/lib/regex_lab.rb @@ -1,13 +1,13 @@ def starts_with_a_vowel?(word) - + !!word.match(/^[aeiouAEIOU]/) end def words_starting_with_un_and_ending_with_ing(text) - + text.scan(/\bun\w+ing\b/) end def words_five_letters_long(text) - + text.scan(/\b\w{5}\b/) end def first_word_capitalized_and_ends_with_punctuation?(text) From e0b9fe049c85aa0d5b0b4643b49dd1c5c8979b7e Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Wed, 10 Jul 2024 11:29:56 -0400 Subject: [PATCH 2/3] first word capitalized and ends with punctuation --- lib/regex_lab.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/regex_lab.rb b/lib/regex_lab.rb index 5652ba03..89948c30 100644 --- a/lib/regex_lab.rb +++ b/lib/regex_lab.rb @@ -11,6 +11,8 @@ def words_five_letters_long(text) end def first_word_capitalized_and_ends_with_punctuation?(text) + # !!text.match(/^[A-Z]\w*\s+.*[.?!]$/) + !! text.match(/^[A-Z].*[.?!]$/) end From b149a817c9ff4deb1a75e615510a631059c420d5 Mon Sep 17 00:00:00 2001 From: Anthony Phillips Date: Wed, 10 Jul 2024 13:30:29 -0400 Subject: [PATCH 3/3] valid phone number --- lib/regex_lab.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/regex_lab.rb b/lib/regex_lab.rb index 89948c30..e0702030 100644 --- a/lib/regex_lab.rb +++ b/lib/regex_lab.rb @@ -11,11 +11,9 @@ def words_five_letters_long(text) end def first_word_capitalized_and_ends_with_punctuation?(text) - # !!text.match(/^[A-Z]\w*\s+.*[.?!]$/) - !! text.match(/^[A-Z].*[.?!]$/) - + !!text.match(/^[A-Z].*[.?!]$/) end def valid_phone_number?(phone) - + !!phone.match(/^(\(?\d{3}\)?[\s\-]?\d{3}[\s\-]?\d{4})$/) end