Skip to content
Open
Changes from 1 commit
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
12 changes: 8 additions & 4 deletions projects/state-mach-regex/extractlinks/extractlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +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