diff --git a/lib/regex_lab.rb b/lib/regex_lab.rb index 60552ab..6a60037 100644 --- a/lib/regex_lab.rb +++ b/lib/regex_lab.rb @@ -1,19 +1,31 @@ def starts_with_a_vowel?(word) - +if word.match(/\b[AEIOUaeiou][a-z]*\b/) + return true +else + return false + end end def words_starting_with_un_and_ending_with_ing(text) - +text.scan(/\w+ing/) end def words_five_letters_long(text) - +text.scan(/\b\w{5}\b/) end def first_word_capitalized_and_ends_with_punctuation?(text) - -end + if text.match(/^[A-Z].+\.$/) + return true + else + return false + end + end def valid_phone_number?(phone) - -end + if phone.match(/([0-9] *?){10}|(\([0-9]{3}\)(([0-9]{3}-[0-9]{4})|[0-9]{7})\b)/) + return true + else + return false + end + end