Strings and Regular Expressions
5 min read
Module Overview
Strings and Regular Expressions
Text shows up everywhere in real programs: names, messages, file contents, user input. This module covers the string methods you’ll use every day, and a first look at regular expressions for finding and validating patterns in text.
Why This Matters
Almost every program eventually has to clean up, check, or rebuild a piece of text: trimming whitespace a user typed, checking that an email looks valid, pulling a piece out of a larger string. These are the tools for that.
What You’ll Learn
- Common string methods for searching, slicing, and transforming text
- Building strings with template literals instead of concatenation
- What a regular expression is, and how to write a simple one
- Using a regular expression to test whether text matches a pattern
- Searching and replacing text with regular expressions
Outcome
By the end of this module, you’ll be able to work confidently with text: cleaning it up, searching it, and validating it against a pattern.
Let’s get started.