Script Valley
Regex: Actually Useful Patterns
Regex for Data Extraction and Transformation/Assessment

Practice & Assessment

Test your understanding of Regex for Data Extraction and Transformation

Multiple Choice Questions

6
1

What is the key difference between a validation regex and an extraction regex for email addresses?

2

Why must user input be escaped before passing to the RegExp constructor?

3

When should you use a CSV library instead of a hand-rolled regex for parsing?

4

In replace(pattern, fn), what arguments does the callback function receive?

5

What approach is safer when highlighting user-generated content in the DOM?

6

Which expression correctly extracts all unique email addresses from a text string?

Coding Challenges

1
1

Log Error Summarizer

Write a function summarizeErrors(logText) that parses a multi-line log file string.

Medium

Mini Project

1

Text Data Extractor CLI Tool

Build a Node.js script extract.js that accepts a file path as a command-line argument and reads the file contents.

Hard