Skip to content

Conversation

@yuriyivanenko
Copy link

I definitely needed ChatGPT to help me out with these

@@ -1,19 +1,21 @@
def starts_with_a_vowel?(word)

!!(word.match(/\A[aeiouAEIOU]/))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!!(word.match(/\A[aeiouAEIOU]/))
word.match?(/\A[aeiouAEIOU]/)


def first_word_capitalized_and_ends_with_punctuation?(text)

!!(text.match(/\A[A-Z][a-z]*.*[.!?]\z/))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!!(text.match(/\A[A-Z][a-z]*.*[.!?]\z/))
text.match?(/\A[A-Z][a-z]*.*[.!?]\z/)


def valid_phone_number?(phone)

!!(phone.match(/\A(\d{10}|\(\d{3}\)\d{7}|\(\d{3}\)\s?\d{3}[-.\s]?\d{4}|\d{3}[-.\s]?\d{3}[-.\s]?\d{4})\z/))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!!(phone.match(/\A(\d{10}|\(\d{3}\)\d{7}|\(\d{3}\)\s?\d{3}[-.\s]?\d{4}|\d{3}[-.\s]?\d{3}[-.\s]?\d{4})\z/))
phone.match(/\A(\d{10}|\(\d{3}\)\d{7}|\(\d{3}\)\s?\d{3}[-.\s]?\d{4}|\d{3}[-.\s]?\d{3}[-.\s]?\d{4})\z/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants