hands-on lab

Constructing Regular Expression Character Classes

Beginner
Up to 30m
4,019
4.4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

Regular Expressions are a tool for searching and manipulating text. Most popular programming languages feature support for them and they are used widely across different disciplines. Regardless of whether you are a developer or engineer, being comfortable reading and writing regular expressions will benefit you.

They are a declarative way of specifying the desired structure of a piece of text. A regular expression can be used to extract information from a larger text, and to validate smaller pieces of text.

In this Lab, you will use the Python programming language to learn the basics of how to use a regular expression and you'll learn about the different character classes available for matching different types of characters.

Learning Objectives

Upon completion of this beginner level Lab, you will be able to:

  • Implement a regular expression using Python
  • Use different character classes to match subsets of a piece of text

Intended Audience

  • Developers
  • Engineers

Prerequisites

Familiarity with the Python programming language will be beneficial but is not required.

The following course can be used to fulfill the prerequisite:

Updates

September 30th, 2022 - Updated IDE to make running scripts easier

January 13th, 2020 - Clarified the validation check is testing that there are no vowels or spaces in the matches 

About the author
Students
67,005
Labs
166
Courses
2
Learning paths
4

Andrew is a Labs Developer with previous experience in the Internet Service Provider, Audio Streaming, and CryptoCurrency industries. He has also been a DevOps Engineer and enjoys working with CI/CD and Kubernetes.

He holds multiple AWS certifications including Solutions Architect Associate and Professional.

Covered topics
Lab steps
Constructing Regular Expression Character Classes