10 Things to Know About Python Regex as An Advanced User

Photo by Romain Vignes on Unsplash

1. Difference between re.search() and re.match()

2. Using capture group to match optional characters

Photo by Stephen Phillips - Hostreviews.co.uk on Unsplash

3. Negation of character Class to match what we don’t know we want

4. What constitutes word characters, represented by \w?

5. Non-Greedy matches (aka Lazy)

<code>Some Code</code>
Greedy vs Non-Greedy(Lazy) Regular Expression

6. Capturing group to pick what to match

Parsing and reconstituting information using Regular Expression feature of Capturing group. Variable flight_matches actually store the information as a list of tuple.
Demonstration of using capturing group to catch repeated characters.

7. Backreferencing of capturing groups

Backreferencing using group method

8. Alternation and Non-Capturing Group

9. Look around — Look ahead and Look behind

10. Yin and Yang: Negative Look arounds




Writing to soothe the soul, programming to achieve flow

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to add images in GitHub repo in read me file.

A modern workplace: Unified Communications, Cloud apps & MS Teams

The Simplest Way to Learn SaltStack

Staking contract

Flutter Basic Widgets

18 Solidity GitHub Repos You Should Check Out

Plug 0.5.0 — Sending to ICNS Names👤 Sonic Activity Enhancements, and Clock Validation! 🚀

How to Dockerize Spring Boot Application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Writing to soothe the soul, programming to achieve flow

More from Medium

Polymorphism in Python (Many Forms)

Introduction to Variables, Data Structures and Operators: Python Complete Course — Part 10

A dummy image for better reading and navigation.

Some tips for using fixtures in pytest

Secant Method Python With Desired Accuracy