Use a Regex Visualizer
00:00 If you ever find yourself needing to tackle more complex replacements or utilize wildcards, you’ll want to dive into the fascinating world of regular expressions, often referred to as regex.
00:14 Regex is like a mini-language consisting of special characters that define patterns. These patterns, known as regexes, are commonly employed for searching strings or performing find-and-replace operations.
00:28 Regex is widely supported across various programming languages, including Python. Of course, that makes it a powerful tool in your arsenal as a programmer.
00:37
But regular expressions can be a bit confusing at first. You don’t believe me? Okay, here is one regex that you’ll use later in this course: a string that starts with r
, and then " [-T:+d]{25}"
.
00:58 What? That looks wild, doesn’t it? So let’s approach regexes step by step with the help of an online regex visualizer.
01:08 The regex visualizer that you will use in this course is regex101.com. It’s free to use, and one of the cool features of regex101 is that you find an explanation, match information, and a quick reference on the right side of your screen.
01:25 The main part is the test string area, where you will insert the transcript in a moment, and the regular expression input field. That’s where you will try out the regular expressions.
01:38
Although regular expressions aren’t bound to a specific programming language, the string that you will use for the regular expression patterns differ a little bit. So I already preselected the Python language, so that’s why you see that r
at the beginning of the string in the regular expression input field.
Become a Member to join the conversation.