Video Coming Soon...

Created by Zed A. Shaw Updated 2026-09-11 06:57:01
 

05: Character Sets

In this exercise you'll learn to match sets of characters rather than just any charactor or a single character.

What is a Set?

A "set" is a list of items that must match exactly, but not in any particular order. The advantage of a set is you can give a range of values to match, which make it easier to write complex regex. For example, if you wanted to only match every character of the alphabet you could write [a-z] which I read as "match 'a' through 'z'."

Previous Lesson Next Lesson

Register for Learn Regex the Hard Way

Register to gain access to additional videos which demonstrate each exercise. Videos are priced to cover the cost of hosting.