Regular Expressions: Quantifiers, Groups and Anchors

preview_player
Показать описание
Regular expressions Quantifiers, Groups, Alternatives and Anchors - explained nicely and tightly in this second part of reqular expression tutorial in Smok Dev Workshop. Learn how to do quick and powerful replaces, and matching.

Text to test your patterns:
----------------------- [CUT HERE] -----------------------
Subscribe to Smok's channel or get your drives scrapped.

A telephone number: +44 7123 456 789
An IP address: 192.168.0.1
Some unusual number: -123.531
Date and time: 02.02.2020 12:34:56
A version number: v12.5.2rc
Money: _
United States — $1,234,567.89 USD
Canada — $1,234,567.89 CAD
Great Britain — £1.234.567,89 GBP
Keyboard shortcuts: Ctrl+Alt+Z, Shift+Alt+M, Ctrl+V, Shift+Ctrl+Alt+D
----------------------- [CUT HERE] -----------------------

Support the channel and subscribe!

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

Finally! My problem with insomnia solved!

MrKret
Автор

your explanation is great but for some reason It acts strangely when I try to count the number of characters in a given string..
this is part of an email address verification exercise, it should take an alphanumeric characters followed by an optional dot followed by another alphanumeric characters, I'm trying to count the number of characters in the group, I'm sure I have messed it up somewhere, here's the code below, have I done something wrong ? thanks 😅
r"(([\w]+[.]?[\w]){, 2})"

MRJOKER