Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .canvas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
:lessons:
- :id: 74061
:course_id: 3299
:canvas_url: https://learning.flatironschool.com/courses/3299/assignments/74061
:type: assignment
31 changes: 31 additions & 0 deletions .github/workflows/canvas-sync-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Sync with Canvas HTML

on:
push:
branches: [master, main]
paths:
- "README.md"

jobs:
sync:
name: Sync with Canvas

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- name: Install github-to-canvas
run: gem install github-to-canvas

# Secret stored in learn-co-curriculum Settings/Secrets
- name: Sync from .canvas file
run: github-to-canvas -a -lr --forkable --contains-html
env:
CANVAS_API_KEY: ${{ secrets.CANVAS_API_KEY }}
CANVAS_API_PATH: ${{ secrets.CANVAS_API_PATH }}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

# Regex Lab
# RegEx Lab

This is a test driven ruby lab designed to get you comfortable using Regex in combination with the `.match` and `.scan` methods. Run `learn` and build out your methods in regex_lab.rb
<p data-visibility='hidden'>View <a href='https://learn.co/lessons/regex-lab' title='Regex Lab'>Regex Lab</a> on Learn.co and start learning to code for free.</p>
## Learning Goals

- Use RegEx to detect patterns in strings

## Instructions

This is a test driven ruby lab designed to get you comfortable using RegEx in combination with the `.match` and `.scan` methods. Run `learn test` and build out your methods in regex_lab.rb

Hint: You can use [rubular.com](https://rubular.com 'Rubular') as a handy tool to test your regular expressions as you write them.
10 changes: 5 additions & 5 deletions lib/regex_lab.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
def starts_with_a_vowel?(word)

! !word.match(/^[aeiou]/i)
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)

text.match?(/^[A-Z].*[.!?]$/)
end

def valid_phone_number?(phone)

phone.match?(/\A(\(\d{3}\)|\d{3})[ .-]?\d{3}[ .-]?\d{4}\z/)
end