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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added projects/state-mach-regex/car_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions projects/state-mach-regex/extractlinks/extractlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ const filename = args[0];
// !!!! IMPLEMENT ME

// Read file

fs.readFile(filename, "utf8", function read(err, data) {
if (err) {
throw err;
}
// Set up regex

const href = data.match(/href="...+"/g)
// Find matches

const link = http.match(href)
Copy link
Author

@kellymanahans kellymanahans Sep 21, 2018

Choose a reason for hiding this comment

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

this is where i got confused. also http should not be there, it's a typo

// Print all matches
console.log(link)
})
// regex expression:
// /href="...+"/g
3 changes: 3 additions & 0 deletions projects/state-mach-regex/phone/phone.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ rl.on('line', function (line) {
// If match found, print number with no spaces, parens, or dashes

// Else print that no number was found

});
// regex expression:
// /[+]?[(]?([0-9]{3})[)]?[-\s]?([0-9]{3})[-\s]?([0-9]{4})/g