Mark As Completed Discussion

This lesson only lists down the basics of regular expressions. There are many other metacharacters available, and their combinations allow us to match complex patterns in texts.

If you are interested in learning more, below is a list of some more metacharacters (and the ones we studied in this lesson) used in regular expressions, along with their usage. Try experimenting with these metacharacters to create unique regular expressions.

MetacharacterCharacter NameUsage
[ ]Square bracketsMatches set of characters specified within them
.PeriodMatches any single character except newline
^CaretMatches the start of string
$DollarMatches the end of string
*AsterikMatches if there are zero or more repetitions
+PlusMatches if there are one or more repetitions
\wLowercase wMatches a single letter, digit, or underscore
\WUppercase WMatches any character which is not a part of \w
\sLowercase sMatches single whitespace character
\SUppercase SMatches any character which is not a part of \s
\dLowercase dMatches decimal digit in the range 0-9
\DUppercase DMatches any character which is not a part of \d
\tLowercase tMatches tab
\nLowercase nMatches newline character