Recall: Regex Syntax Reference

| or
() grouping
^ start
$ end
special chars
* 0 or more
+ 1 or more
? 0 or 1
{min,max} between min and max
quantifiers
[abcde] one of those characters
[a-z] a character from a through z
\d digit
\s whitespace
character sets

Exercise : Regular Expressions (by Zack Cava)

Write a regular expression (slides) that would match the following kinds of patterns. You can use the site Rubular to test your regex.

Exercise Solution