Introduction to Regular expressions

Let's learn about regular expressions in Python.

Regular expressions is basically a tiny language all their own that we can use inside Python and many other programming languages. We will often hear regular expressions referred to as “regex”, “regexp” or just “RE”. Some languages, such as Perl and Ruby, actually support regular expression syntax directly in the language itself. Python only supports them via a library that we need to import. The primary use for regular expressions is matching strings. We create the string matching rules using a regular expression and then we apply it to a string to see if there are any matches.

Get hands-on with 1200+ tech skills courses.