Regular Expressions in Python || Python Tutorial || Learn Python Programming

preview_player
Показать описание
Regular Expressions (regex for short) is a way to search for patterns in strings. Python provides the re module to assist you in your efforts to search through strings. Maybe you want to find names in a database that satisfy certain conditions. But before you charge right in and start throwing regular expressions around, you need to learn the correct syntax.

In this video, you’ll learn how to compose regular expressions using such cryptic symbols as the caret (^), dollar sign ($), various backslashes (\d, \s, \w), and more. And just wait ‘til you see what happens when you start combining them into a powerful combo search expression.

We also introduce such concepts as quantifiers so you can see how many times you get a match. Match, that’s another handy function, along with fullmatch. You’ll learn how useful it can be to create groups to name certain parts of a regex. We could go on, but it makes more sense for you to watch the video and take notes. Then share it with a friend and have them take notes. Then you can compare your notes and see if you are in agreement.
We were able to bring you this video thanks to our generous Kickstarter backers! Find their names hidden (okay, not very hidden) in the video!

Find our programming playlists here:

Subscribe to Socratica + bell for notifications:

⧓⧓⧓⧓⧓
We recommend:
How to Be a Great Student

Python Cookbook, 3rd edition

The Mythical Man Month - Essays on Software Engineering & Project Management

⧓⧓⧓⧓⧓
Join this channel to get access to perks:

Support Socratica on Patreon:

Written & Produced by Michael Harrison
Edited by Megi Shuke and Michael Harrison

#Python #RegularExpressions #regex
Рекомендации по теме
Комментарии
Автор

Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

LandOfSigh
Автор

I absolutely love Ulka's ability to deliver the dry sense of humor that permeates these videos. "To use regular expressions with python, import the 're' module. After hours of research, we were unable to find what 're' stands for."

patricksweeney
Автор

Hi! I was a first year student when i used to watch your python tutorials.
Now i am a full-time Data Eng. and seeing your videos again makes me kinda nostalgic (in a positive way).
Thanks so much for your work, your videos helped me a lot during my first steps ❤

massimo
Автор

I didn't expect it to be this easy to understand, thanks guys.

jagadishgospat
Автор

Ulka has perfected her character. More of her teaching everything. She's awesome

Allen-byci
Автор

I thought I had some idea about regular expressions but now I know there's so much more to the re module.
Thanks for inspiring us to dive deeper into the re module.

bassbacke
Автор

Great to see another one of these videos. They're clear, concise and the format is really fun.

martinus
Автор

Perfect timing, we're just starting with re in our Python class!

nonominox
Автор

Love that Socratica is back! Y'all make the best educational videos I've seen in a long time, just binged the abstract algebra playlist and now hoping into more learning! Thank you!!

davidawakim
Автор

Great video. Note however that in the last examples with the URLs, you are using '.' to look for a literal dot in the URL. A single dot in a pattern matches any character. If you want to look for a literal dot, you need to use '\.'. Also, Python supports verbose regular expressions, that allow comments inside the code.

HexenzirkelZuluhed
Автор

Glad these series is still alive and well :DD

sarundayo
Автор


Quick Note: In regular expressions, a dot . matches ANY character. So our URL regex, https?://w{3}.\w+ etc works, but could be greatly improved if we replace the . pattern with \.
The \. matches only the period.

Socratica
Автор

Welcome back! Really happy to see your long videos again since you are the best teacher I've ever had

MrPioneer
Автор

I'm happy to see a new Python video here!

brunosantos
Автор

Seeing an upload of a Python tutorial with Ulka from Socratica once again after all this time made me incredibly happy.

Seriously, all of these are a bloody gem

EuphoricRaccoon
Автор

RegEx is one of the most beautiful things that exists. Python make RegEx really easy and simple to use. 😍

gamorales
Автор

I love Socratica so much. The writing, presentation and subject matter are awesome.

BrianStDenis-pjtq
Автор

❤Thank you for creating more Python videos! Theses are THE BEST! You ladies are awesome, thanks for making knowledge accessible.

ehouston
Автор

These videos rock. Have been leveraging them to learn Python. Thank you.

dewaynescott
Автор

Love the python videos here at Socratica!

WendimuSitotaw