
Master regular expressions (regex) quickly with this accelerated training that covers search and replace, data extraction, and everyday use by developers, taught by Arthur Bandeira.
Learn runtime and code editor setup tips and pitfalls, and understand what regular expressions are, in this module.
Learn practices for our q&a section by sharing error messages, screenshots, environment setup, and test data; encourage users to search for existing answers, use keywords, and help others with kindness.
Explore online tools for practicing regular expressions, using RegEx 101 to visualize patterns, set flags, and test strings, while also noting future setup of a JavaScript/NodeJS environment.
Install nodejs from nodejs.org using the lts version. Run JavaScript files with node filename.js on Windows, Mac, or Linux, and use VS Code or Code Runner, saving before rerun.
Explore how regular expressions define search patterns to match and manipulate strings, including find and replace and input validation, with practical uses like emails and csv data extraction.
Learn to declare regular expressions in JavaScript using new RegExp('pattern') or regex literals, test strings with the execute method or match, and perform pattern matching such as 'scream' and 'you'.
Explore how flags in regular expressions change search behavior, using the global flag to match all comma occurrences and the case-insensitive flag to find cream in any case.
Explore JavaScript API methods for regular expressions, including match, split with regex and limit, and replace with a global flag to replace all; learn dynamic separators and handling syntax errors.
Learn how escape sequences in JavaScript strings use the backslash to literalize quotes, backticks, and non-printing characters, and understand why the backslash itself must be escaped.
Explore regex metacharacters, the special symbols akin to escape sequences, and learn how they define search patterns in pattern processing, with examples to be covered in upcoming lessons.
Explore metacharacters with the any single character wildcard, learning to match any three digits inside parentheses for phone area codes, using the period symbol and the match method.
Explore how the backslash s metacharacter matches whitespace, including tabs and line breaks, and learn to capture these sequences with the global match flag.
Learn the alternation operator in regular expressions, using the pipe symbol to match a choice and the global flag to match both options individually.
Compare regex literals and RegExp instances, noting performance, flexibility, and escaping rules for string-based patterns.
Explore how Unicode maps code points to characters and match them in regex with the backslash u notation or curly brace escapes, enabled by the Unicode flag U.
Explore how flags influence the regex engine search behavior, learn JavaScript API methods for regular expressions, and master escape sequences and meta characters to build smarter regular expressions.
Explore the character classes chapter to build leaner, more effective regular expressions using character classes, shorthand, and ranges. See you in the next lessons.
Learn how character classes in regex use square brackets to match digits and vowels, comparing them to alternation, with an address exercise to match odd and even digits and vowels.
Learn to define character ranges inside regex character classes using a hyphen within square brackets. Understand case sensitivity, multiple ranges, and valid ordering by ASCII/Unicode code points, with JavaScript examples.
Learn how meta characters behave inside character classes, and escape the hyphen, closing square bracket, and caret with a backslash to prevent unintended ranges or negation.
Ranges exist only inside a character class and must follow Unicode order; watch for invalid order, while multiple ranges can combine to span capitals and lowercase letters, a six-character gap.
Explore shorthand character classes like \d, \w, and \s to capture digits, word characters, and whitespace. Apply their negated forms \D, \W, and \S for smaller, more expressive regex.
Explore the not operator inside a character class to match characters not in a set, including negated ranges and shorthand classes like \D, \S, and \W.
Define Unicode ranges in regex using literal characters or the Unicode escape syntax, and enable the Unicode flag to match symbols such as mathematical operators and arrows.
Take your regular expressions to the next level by writing less code with character classes, shorthand, and ranges, including Unicode ranges. See how these ranges affect meta characters.
Explore quantifiers in regex, explain how to use them, compare greedy and lazy quantifiers, and tackle practical challenges to reinforce learning.
Master the plus quantifier in regular expressions, matching one or more occurrences and back-to-back patterns, and combine it with character classes to group digits like 42 and shorthand character classes.
Master the zero or more quantifier, the asterisk, to match a digit followed by zero or more zeros. Use a 1–9 range to match patterns like 110 or 202,000.
Learn the exact quantity quantifier in regex, using curly braces to set lower and upper limits, with examples of exact three characters and min two max three.
Match social security numbers, phone numbers with optional hyphen, and emails with user identifiers and customizable domains using regular expressions. Explore three exercises to practice regex skills.
Master the social security number pattern by matching three digits, a hyphen, two digits, a hyphen, and four digits using exact quantifiers or the \d shorthand.
Create a regex to match phone numbers in a string with three digits in parentheses, whitespace, another three digits, an optional hyphen, and four digits, and share insights in Q&A.
Match the email pattern with a user identifier and domain, allowing periods or underscores and a two-to-four character top-level domain, with a bonus to optionally match both parts.
Explore quantifiers, their match behaviors, and the difference between greedy and lazy quantifiers, including how to set them to lazy, with practical exercises reinforcing the concepts.
Explore how groups in regex treat multiple literals or classes as single units, enabling alternation, quantifiers, and optional patterns for matching urls and emails.
Explore capturing and non-capturing groups in regular expressions, using back references to enforce repeat patterns like last name first name last name, and distinguish how non-capturing groups avoid back references.
Master nested groups in regex by combining capturing groups with alternation and back reference, using examples like supersonic, hypersonic, ultrasonic, and prioritizing clarity over unnecessary nesting.
Learn about named capturing groups in regex to create back references in JavaScript, using the ?<name> syntax and \\K, with naming rules to avoid starting with numbers and repeated names.
Explore lookarounds in regex, using positive and negative lookahead assertions to conditionally match without capturing, with examples like currency symbols and three-digit numbers.
Explore look behind patterns in regex, including positive and negative look behind, and learn to match or exclude prefixes like Mr. in a list of code names using assertion patterns.
Master advanced regular expressions by using capturing and non-capturing groups, back references, named capturing groups, nested groups, character classes, meta characters, and look arounds for greater specificity in patterns.
Explore the anchors chapter to craft more specific regular expressions and develop a solution for a previously shown problem. See you in the next lessons.
Explore anchors in regex as zero-length assertions that mark the start or end of a string using the caret and dollar sign, guiding build processes.
Learn how word boundaries mark positions between word and non word characters, enabling full word matches. Use the backslash metacharacter to define starts and ends like calm.
Explain why dot all flag isn’t in JavaScript and how dot metacharacter misses line breaks, using a whitespace shorthand with its complementary version inside a character class and zero-or-more quantifier.
The multiline flag makes each line a separate string, creating a start and end of string per line. These anchors specify search locations and narrow the regex engine's work.
Master how to tighten regular expressions with word boundaries and anchors to narrow search locations and boost precision.
Explore the recipes chapter to apply familiar concepts through solving common regex problems such as syntax highlighting, matching number ranges, IPV four patterns, and password validation.
Identify language tokens in Java code using regular expressions to highlight strings, keywords, types, and comments with color-coded rules for double-quoted strings, full-word keywords, and // and /* comments.
Learn to build a regex that matches five- and nine-digit zip codes, using a hyphen for nine-digit formats, plus digit shorthand, exact quantifiers, and start/end anchors with multi-line support.
Learn to build a regex that matches IPv4 addresses, with four dot-separated parts from 0 to 255, using non-capturing groups, alternation, and template string interpolation to reuse the pattern.
Build a password validation regex that enforces length 6–20 and requires uppercase, lowercase, digit, and a special symbol, using start and end anchors with positive lookaheads.
Learn how to read a CSV file in JavaScript, parse the header for keys, convert rows into objects with regular expressions, build an array, and export JSON.
Apply varied perspectives to regex concepts learned previously, and identify the right tools for each situation to improve your approach to matching Unicode ranges.
Celebrate completing the accelerated regular expressions training. The journey will change how you approach problems with regular expressions in the future.
Regular expressions (Regex) are a rather simple technique to grasp but, nonetheless, of extreme importance in the programming field. If I had to guess, however, I would venture to say that most programmers are not acquainted with even the most elementary principles of Regex.
Sure, You could tell me: “I have survived so far without knowing Regex.”; chances are, however, that the moment will come for you to face a task that includes the need to work with text, in which case I’m sad to tell you that your code will quickly “join the dark side of the Force”... Jokes aside, I can assure you that, without Regex, you will miss many tools that would enable you to write cleaner, more efficient code, not to mention they would save you a considerable amount of time and quite a bit of effort!
For a quick glance at the topics you will learn on Regex:
Groups
Character classes (also known as “Character sets”)
Quantifiers
Backreferences
Flags
Borders
If you are not familiar with any of these subjects, or even if you would like to deepen and/or broaden your knowledge while developing some handy skills, this course will greatly help you not only to effectively use Regular Expressions but also (and more importantly) to become a more well-rounded programmer.
It will certainly be a joy and a privilege to have you as our student!
We wish you all the best and a great learning experience!