From 7364a7d5b2d075890d9f20648dd45f49c74cdbed Mon Sep 17 00:00:00 2001 From: noven temer Date: Thu, 26 Jan 2017 19:03:04 +0000 Subject: [PATCH] Done. --- lib/regex_lab.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/regex_lab.rb b/lib/regex_lab.rb index 60552ab..b8c458c 100644 --- a/lib/regex_lab.rb +++ b/lib/regex_lab.rb @@ -1,19 +1,20 @@ def starts_with_a_vowel?(word) - +word.match(/^[aEiAuIo]/)? true : false end def words_starting_with_un_and_ending_with_ing(text) - +text.scan(/un\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) - +# text.match(/^[a-zA-Z]\w[\.!?]$/) ? true : false +text.match(/^[A-Z].*[\.!?]$/) ? true : false end def valid_phone_number?(phone) - +phone.match(/[0-9]{3}\s[0-9]{3}\s[0-9]{4}\Z|\([0-9]{3}\)[0-9]{3}-[0-9]{4}$|\([0-9]{3}\)[0-9]{3}[0-9]{4}$|[0-9]{10}/) ? true : false end